Re: 8.0-RC USB/FS problem

2009-12-02 Thread Stefan Esser
On 22.11.2009 10:47 Hans Petter Selasky wrote:
 Other operating systems do a port bus reset when the device has a problem. On 
 FreeBSD we just try a software reset via the control endpoint. I guess that 
 it 
 is a device problem you are seeing. The USB stack in FreeBSD is faster than 
 the old one, and maybe the faster queueing of mass storage requests trigger 
 some hidden bugs in your device.
 
 When the problem happens try:
 
 sysctl hw.usb.umass.debug=-1

I have observed USB lock-ups with several external drive enclosures
that used to work with the old USB stack (and continue to work when
connected to a Windows notebook, for example). (BTW: System is AMD X2
with Nvidia chip-set and i386 kernel.)

In my case, hw.usb.debug=6 makes the drive work at some 4MB/s for
any amount of data transfered, while hw.usb.debug=5 (and an ylower
value) lets the drive pause for about 1 Minute per 100MB transfered.
I wanted to test whether short delays inserted in the places with
DPRINTFN(6, ...) make a difference, but will not get to it before
the weekend.

Regards, STefan
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


RE: 8.0-RC USB/FS problem

2009-12-02 Thread Guojun Jin
I noticed that your machine also has an AMD CPU. Hopefully this may NOT
imply something to the hardware.

I will find more systems especially Intel CPUs to do further test.

-Original Message-
From: Stefan Esser [mailto:s...@freebsd.org] 
Sent: Monday, November 30, 2009 12:18 PM
To: Hans Petter Selasky
Cc: freebsd-...@freebsd.org; b...@freebsd.org;
freebsd-stable@freebsd.org; Guojun Jin
Subject: Re: 8.0-RC USB/FS problem

On 22.11.2009 10:47 Hans Petter Selasky wrote:
 Other operating systems do a port bus reset when the device has a
problem. On 
 FreeBSD we just try a software reset via the control endpoint. I guess
that it 
 is a device problem you are seeing. The USB stack in FreeBSD is faster
than 
 the old one, and maybe the faster queueing of mass storage requests
trigger 
 some hidden bugs in your device.
 
 When the problem happens try:
 
 sysctl hw.usb.umass.debug=-1

I have observed USB lock-ups with several external drive enclosures
that used to work with the old USB stack (and continue to work when
connected to a Windows notebook, for example). (BTW: System is AMD X2
with Nvidia chip-set and i386 kernel.)

In my case, hw.usb.debug=6 makes the drive work at some 4MB/s for
any amount of data transfered, while hw.usb.debug=5 (and an ylower
value) lets the drive pause for about 1 Minute per 100MB transfered.
I wanted to test whether short delays inserted in the places with
DPRINTFN(6, ...) make a difference, but will not get to it before
the weekend.

Regards, STefan
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: 8.0-RC USB/FS problem

2009-11-26 Thread Hans Petter Selasky
On Thursday 26 November 2009 08:30:52 Guojun Jin wrote:
 Most crash had the same back trace. This is also true when USB access
 hangs, then unplug the drive.

I think from the backtrace that this is not an USB issue. It is a file-system 
issue.

--HPS

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


RE: 8.0-RC USB/FS problem

2009-11-26 Thread Guojun Jin
Shall I fill a defect? or someone on this mailing list can take care of this 
problem before release.

-Jin

-Original Message-
From: Hans Petter Selasky [mailto:hsela...@c2i.net]
Sent: Thu 11/26/2009 12:20 AM
To: Guojun Jin
Cc: freebsd-...@freebsd.org; b...@freebsd.org; freebsd-stable@freebsd.org
Subject: Re: 8.0-RC USB/FS problem
 
On Thursday 26 November 2009 08:30:52 Guojun Jin wrote:
 Most crash had the same back trace. This is also true when USB access
 hangs, then unplug the drive.

I think from the backtrace that this is not an USB issue. It is a file-system 
issue.

--HPS


___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: 8.0-RC USB/FS problem

2009-11-26 Thread Thomas Backman
On Nov 26, 2009, at 8:25 PM, Guojun Jin wrote:

 Shall I fill a defect? or someone on this mailing list can take care of this 
 problem before release.
 
 -Jin
8.0 is halfway out already, you can download -RELEASE ISOs or upgrade using 
freebsd-update. The main announcement just hasn't been made yet.

Regards,
Thomas___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: 8.0-RC USB/FS problem

2009-11-25 Thread Hans Petter Selasky
On Wednesday 25 November 2009 00:08:59 Guojun Jin wrote:
 What other debug shall we turn on to analyze this problem.

Are you able to extract the panic message? Try enabling dump on the swap 
partition.

--HPS
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: 8.0-RC USB/FS problem

2009-11-25 Thread Norbert Papke
On November 24, 2009, Jeremy Chadwick wrote:

 $ host www.daemonfun.com
 www.daemonfun.com is an alias for daemonfun.com.
 daemonfun.com has address 76.202.192.211
 daemonfun.com mail is handled by 10 mh1.daemonfun.com.
 daemonfun.com mail is handled by 20 mh2.daemonfun.com.
 
 $ fetch http:/www.daemonfun.com/
 fetch: http:/www.daemonfun.com/: No address record
 
 I haven't examined the code, but my guess is fetch is trying to do a
 lookup on the FQDN http:/www.daemonfun.com/.  Who wants to file a PR?

As Dan Nelson mentioned, it's just a typo in the url.

Try 

 $ fetch http://www.daemonfun.com/

Note the :// rather than :/.

Cheers.

-- Norbert Papke.
   npa...@acm.org


http://saveournet.ca
Protecting your Internet's level playing field
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


RE: 8.0-RC USB/FS problem

2009-11-25 Thread Guojun Jin
I will do,

I also borrowed two other machiens -- one AMD two core laptop, and one P4 
desktop -- for further testing.
I will enable kernel coredump for all of them and will make cores available by 
end of today.

-Jin

-Original Message-
From: Hans Petter Selasky [mailto:hsela...@c2i.net]
Sent: Wed 11/25/2009 12:37 AM
To: Guojun Jin
Cc: freebsd-...@freebsd.org; b...@freebsd.org; freebsd-stable@freebsd.org
Subject: Re: 8.0-RC USB/FS problem
 
On Wednesday 25 November 2009 00:08:59 Guojun Jin wrote:
 What other debug shall we turn on to analyze this problem.

Are you able to extract the panic message? Try enabling dump on the swap 
partition.

--HPS

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


RE: 8.0-RC USB/FS problem

2009-11-25 Thread Guojun Jin
Most crash had the same back trace. This is also true when USB access hangs, 
then unplug the drive.

More interesting is the third AMD laptop (dual core) had similar problem, but 
it is less crashing but hanging.

The core information is available at the same place (bt file is also attached):

http://www.daemonfun.com/archives/public/USB

-rw-r--r--  1 jin wheel  4668 Nov 25 23:17 bt
-rw---  1 4294967294  wheel 80074 Nov 25 22:59 core.txt.0
-rw-r--r--  1 4294967294  wheel  72108588 Nov 25 23:09 coredump-0.tbz

core.txt.0 is from savecore, and bt is I did back trace so it has slightly more 
information than core.txt.
The tbz file contains the kernel.symbol and all files from savecore.

I will continute to dig this and I will set more coredump if new crash happens 
at different place.
Please let me know anything I can help debug futher before Dec 3rd. I will on 
travel for a while and I do
not want to hold release for another two weeks. So let's resolve the problem 
before I am on travel if possible.

-Original Message-
From: Hans Petter Selasky [mailto:hsela...@c2i.net]
Sent: Wed 11/25/2009 12:37 AM
To: Guojun Jin
Cc: freebsd-...@freebsd.org; b...@freebsd.org; freebsd-stable@freebsd.org
Subject: Re: 8.0-RC USB/FS problem
 
On Wednesday 25 November 2009 00:08:59 Guojun Jin wrote:
 What other debug shall we turn on to analyze this problem.

Are you able to extract the panic message? Try enabling dump on the swap 
partition.

--HPS




bt
Description: bt
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org

RE: 8.0-RC USB/FS problem

2009-11-24 Thread Guojun Jin
Freshly installed 8.0-RELEASE on two differnt machines, and USB stick work well 
so far, but the USB hard drive
still has crash on this SMP (4-core AMD phenom 9600) during the dump/restore. I 
will try it on the single CPU
machine tomorrow.

Re-tested dump/restore with FreeBSD 6.3/6.4 on this SMP machine and they are 
working well.

Also the another strange thing ocurred during the mount a partition on /tmp, 
which ended with two /tmp,
and the last one mounted is on the top (the first should be hidden):

: df
Filesystem  1K-blocks UsedAvail Capacity  Mounted on
/dev/ad0s1a756750   165484   53072624%/
devfs   110   100%/dev
/dev/ad0s2e  43194318 27833648 1190512670%/data
/dev/ad0s2d   9135182  5870390  253397870%/home
/dev/ad0s1e50763034882   432138 7%/tmp
/dev/ad0s1f  13246730  1424522 1076247012%/usr
/dev/ad0s1d   507703812700  4658176 0%/var
/dev/da0s2 661176   487660   12062280%/mnt
/dev/da1s3d   91351824  8404364 0%/dist
/dev/da1s3e  749389484 68943830 0%/tmp

: df /tmp
Filesystem  1K-blocks UsedAvail Capacity  Mounted on
/dev/da1s3e  749389484 68943830 0%/tmp

-Original Message-
From: Guojun Jin
Sent: Sun 11/22/2009 7:59 PM
To: Hans Petter Selasky; freebsd-...@freebsd.org
Cc: b...@freebsd.org; freebsd-stable@freebsd.org
Subject: RE: 8.0-RC USB/FS problem
 
From more intensive diagnose, it looks like more related USB layer.

repeated a few time on following process and ithe crash happened at different 
USB access phase at each time.

dd if=/dev/zero of=/dev/da0 count=1000 bs=4k
sysinstall
partition 
 slice 1 (da0s1) 18GB ID=12
 slice 2 (da0s2) 10-15GB Id=165
 slice 3 (da0s3) rest ID=165
 W --- OK
label
 da0s3d 9GB /mnt
 da0s3e rest/dist
 W --- da0s3e  device is not configured.

w# ll /dev/da0*  # after sysinstall did partition + W at 1st time
crw-r-  1 root  operator0,  97 Nov 22 11:23 /dev/da0
crw-r-  1 root  operator0,  98 Nov 22 11:23 /dev/da0s1
crw-r-  1 root  operator0,  99 Nov 22 11:23 /dev/da0s2
crw-r-  1 root  operator0, 100 Nov 22 11:23 /dev/da0s3

# ll /dev/da0*  # after sysinstall start at 2nd time
crw-r-  1 root  operator0,  97 Nov 22 11:27 /dev/da0
System crashed

The crash log is available at 
http:/www.daemonfun.com/archives/pub/USB/crash1-reset.bz2
(All logs are based on hw.usb.umass.debug=-1)

After system reboot, and repeated above processes, the da0s3e was mounted on 
/dist, but da0s3d cannot.
It tunred out that newfs fail inside labeling process in sysinstall. Manually 
did newfs on da0s3d, and
it cannot be mounted on /mnt, but access to it caused crash.
The crash log is available at http:/www.daemonfun.com/archives/pub/USB/newfs

Tried entire process again, this time, both partitons are formatted (newfs) 
inside labaling process (sysinstall)
but crahsed system during dump/restore on da0s3e (/dist).
The crash log is available at 
http:/www.daemonfun.com/archives/pub/USB/usb-log.crash2.bz2, which is huge one.
It contains two parts, one dump/restore IDE to da0s3d (passed), and the rest is 
dump/restore to da0s3e (crashed).

I am going to reinstall the system with the new ISO from Nov 21 8.0-RELEASE to 
see if anything will improve.

-Original Message-
From: Hans Petter Selasky [mailto:hsela...@c2i.net]
Sent: Sun 11/22/2009 1:47 AM
To: freebsd-...@freebsd.org
Cc: Guojun Jin; b...@freebsd.org; freebsd-stable@freebsd.org
Subject: Re: 8.0-RC USB/FS problem
 
On Sunday 22 November 2009 05:38:13 Guojun Jin wrote:
 Tried on the USB hard drive:

 Deleted slice 3 and recreated slice 3 with two partitions s3d and s3e.
 Was happy because successfully did dump/restore on s3d, and thought it just
 partition format issue; but system crashed during dump/restore on s3e, and
 partition lost the file system type.

 wolf# mount /dev/da0s3e /mnt
 WARNING: /mnt was not properly dismounted
 /mnt: mount pending error: blocks 35968 files 0
 wolf# fsck da0s3e
 fsck: Could not determine filesystem type
 wolf# bsdlabel da0s3
 # /dev/da0s3:
 8 partitions:
 #size   offsetfstype   [fsize bsize bps/cpg]
   c: 1757350350unused0 0 # raw part,
 don't edi t
   d: 1887436804.2BSD0 0 0
   e: 156860667 188743684.2BSD0 0 0

 Therefore, tried directly use fsck_ufs on both USB hard drive and USB stick
 to get file system clean up. All data got back now.

 The machine has run with FreeBSD 6.1 all the way to 7.2 without such
 problem. How can we determine what could go wrong in 8.0? FS or USB.

Hi,

Error 5 means IO error, so probably the transport layer, USB or lower, is to 
blame.

Some things to check:

1) Make sure the connection for your memory stick is Ok.
2) Make sure there is enough power

Re: 8.0-RC USB/FS problem

2009-11-24 Thread Hans Petter Selasky
On Tuesday 24 November 2009 09:12:45 Guojun Jin wrote:
 http:/www.daemonfun.com/archives/pub/USB/crash1-reset.bz2

I'm not able to fetch this file. Could you extract the panic backtrace?

--HPS
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


RE: 8.0-RC USB/FS problem

2009-11-24 Thread Guojun Jin
Sorry for the typo -- it is public not pub in the middle. The others should be 
all public.

http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2

-Original Message-
From: Hans Petter Selasky [mailto:hsela...@c2i.net]
Sent: Tue 11/24/2009 12:33 AM
To: Guojun Jin
Cc: freebsd-...@freebsd.org; b...@freebsd.org; freebsd-stable@freebsd.org
Subject: Re: 8.0-RC USB/FS problem
 
On Tuesday 24 November 2009 09:12:45 Guojun Jin wrote:
 http:/www.daemonfun.com/archives/pub/USB/crash1-reset.bz2

I'm not able to fetch this file. Could you extract the panic backtrace?

--HPS

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: 8.0-RC USB/FS problem

2009-11-24 Thread Hans Petter Selasky
On Tuesday 24 November 2009 17:58:47 Guojun Jin wrote:
 Sorry for the typo -- it is public not pub in the middle. The others should
 be all public.

 http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2


%fetch http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2
fetch: http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2: No 
address record

--HPS

 -Original Message-
 From: Hans Petter Selasky [mailto:hsela...@c2i.net]
 Sent: Tue 11/24/2009 12:33 AM
 To: Guojun Jin
 Cc: freebsd-...@freebsd.org; b...@freebsd.org; freebsd-stable@freebsd.org
 Subject: Re: 8.0-RC USB/FS problem

 On Tuesday 24 November 2009 09:12:45 Guojun Jin wrote:
  http:/www.daemonfun.com/archives/pub/USB/crash1-reset.bz2

 I'm not able to fetch this file. Could you extract the panic backtrace?

 --HPS

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: 8.0-RC USB/FS problem

2009-11-24 Thread Jeremy Chadwick
On Tue, Nov 24, 2009 at 06:13:21PM +0100, Hans Petter Selasky wrote:
 On Tuesday 24 November 2009 17:58:47 Guojun Jin wrote:
  Sorry for the typo -- it is public not pub in the middle. The others should
  be all public.
 
  http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2
 
 
 %fetch http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2
 fetch: http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2: No 
 address record
 
 --HPS
 
  -Original Message-
  From: Hans Petter Selasky [mailto:hsela...@c2i.net]
  Sent: Tue 11/24/2009 12:33 AM
  To: Guojun Jin
  Cc: freebsd-...@freebsd.org; b...@freebsd.org; freebsd-stable@freebsd.org
  Subject: Re: 8.0-RC USB/FS problem
 
  On Tuesday 24 November 2009 09:12:45 Guojun Jin wrote:
   http:/www.daemonfun.com/archives/pub/USB/crash1-reset.bz2
 
  I'm not able to fetch this file. Could you extract the panic backtrace?
 
  --HPS

The above issue is unrelated to the USB/FS problem.  It looks like
fetch(1) has a parser bug.  Note the text portion between the URI and
URL is colon-slash not colon-slash-slash like it should be.

Reproduction:

$ host www.daemonfun.com
www.daemonfun.com is an alias for daemonfun.com.
daemonfun.com has address 76.202.192.211
daemonfun.com mail is handled by 10 mh1.daemonfun.com.
daemonfun.com mail is handled by 20 mh2.daemonfun.com.

$ fetch http:/www.daemonfun.com/
fetch: http:/www.daemonfun.com/: No address record

I haven't examined the code, but my guess is fetch is trying to do a
lookup on the FQDN http:/www.daemonfun.com/.  Who wants to file a PR?
:-)

-- 
| Jeremy Chadwick   j...@parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: 8.0-RC USB/FS problem

2009-11-24 Thread Dan Nelson
In the last episode (Nov 24), Jeremy Chadwick said:
 On Tue, Nov 24, 2009 at 06:13:21PM +0100, Hans Petter Selasky wrote:
  On Tuesday 24 November 2009 17:58:47 Guojun Jin wrote:
   Sorry for the typo -- it is public not pub in the middle. The others 
   should
   be all public.
  
   http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2
  
  
  %fetch http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2
  fetch: http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2: No 
  address record
 
 The above issue is unrelated to the USB/FS problem.  It looks like
 fetch(1) has a parser bug.  Note the text portion between the URI and URL
 is colon-slash not colon-slash-slash like it should be.

That's a typo in the URL, not a bug in fetch :)

-- 
Dan Nelson
dnel...@allantgroup.com
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: 8.0-RC USB/FS problem

2009-11-24 Thread Jeremy Chadwick


On Tue, Nov 24, 2009 at 12:16:54PM -0600, Dan Nelson wrote:
 In the last episode (Nov 24), Jeremy Chadwick said:
  On Tue, Nov 24, 2009 at 06:13:21PM +0100, Hans Petter Selasky wrote:
   On Tuesday 24 November 2009 17:58:47 Guojun Jin wrote:
Sorry for the typo -- it is public not pub in the middle. The others 
should
be all public.
   
http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2
   
   
   %fetch http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2
   fetch: http:/www.daemonfun.com/archives/public/USB/crash1-reset.bz2: No 
   address record
  
  The above issue is unrelated to the USB/FS problem.  It looks like
  fetch(1) has a parser bug.  Note the text portion between the URI and URL
  is colon-slash not colon-slash-slash like it should be.
 
 That's a typo in the URL, not a bug in fetch :)

It's a bug in libfetch, specifically the fetchParseURL(3) function.
Relevant code from src/usr.bin/fetch/fetch.c:

 312 static int
 313 fetch(char *URL, const char *path)
 314 {
 315 struct url *url;
 ...
 342 /* parse URL */
 343 if ((url = fetchParseURL(URL)) == NULL) {
 344 warnx(%s: parse error, URL);
 345 goto failure;
 346 }

The man page for fetchParseURL(3) claims:

 fetchParseURL() takes a URL in the form of a null-terminated string and
 splits it into its components function according to the Common Internet
 Scheme Syntax detailed in RFC1738.  A regular expression which produces
 this syntax is:

 scheme:(//(user(:pwd)?@)?host(:port)?)?/(document)?

 If the URL does not seem to begin with a scheme name, the following syn-
 tax is assumed:

 ((user(:pwd)?@)?host(:port)?)?/(document)?

 .

 fetchParseURL() returns a pointer to a struct url containing the individ-
 ual components of the URL.  If it is unable to allocate memory, or the
 URL is syntactically incorrect, fetchParseURL() returns a NULL pointer.

If we add some debugging code *before* the scheme assumption portion
of fetch.c (which actually looks at the hostname portion and if it
starts with ftp assumes the scheme is FTP, http = HTTP, etc.):

 348 printf(fetchParseURL() successful.  struct details:\n);
 349 printf(url-scheme = %s\n, url-scheme);
 350 printf(url-user   = %s\n, url-user);
 351 printf(url-pwd= %s\n, url-pwd);
 352 printf(url-host   = %s\n, url-host);
 353 printf(url-port   = %d\n, url-port);
 354 printf(url-doc= %s\n, url-doc);

...we end up with this:

$ ./fetch http:/www.daemonfun.com/
fetchParseURL() successful.  struct details:
url-scheme = http
url-user   =
url-pwd=
url-host   =
url-port   = 0
url-doc= /www.daemonfun.com/
fetch: http:/www.daemonfun.com/: No address record

Here we can see the libfetch code properly works out the scheme (URI) on
its own (which means the assumption part of the man page should not
play a role here) -- but incorrectly parses the remaining portion of the
URL.

In this situation, fetchParseURL(3) should return NULL.

The code in fetch.c continues on to call fetchXGet(3) with the above
struct data (some of it gets modified, but that's besides the point),
and the result is fetchXGet(3) returning NULL (indicating the fetch
failed in some way), which gets us here:

 463 f = fetchXGet(url, us, flags);
 ...
 468 if (f == NULL) {
 469 warnx(%s: %s, URL, fetchLastErrString);
 470 if (i_flag  strcmp(url-scheme, SCHEME_HTTP) == 0
 471  fetchLastErrCode == FETCH_OK
 472  strcmp(fetchLastErrString, Not Modified) == 0) {
 473 /* HTTP Not Modified Response, return OK. */
 474 r = 0;
 475 goto done;
 476 } else
 477 goto failure;
 478 }

We modify some code to add some debugging to validate that warnx() is
what's returning the error message:

 469 warnx(fetchXGet() returned NULL: %s: %s, URL, 
fetchLastErrString);

...and we end up with:

fetch: fetchXGet() returned NULL: http:/www.daemonfun.com/: No address record

I guess I'll be the one to file the PR.

-- 
| Jeremy Chadwick   j...@parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


RE: 8.0-RC USB/FS problem

2009-11-24 Thread Guojun Jin
Interesting now by some incident :-)

The single CPU machine (Intel P4) with 8.0 works fine on the USB drives
and the USB stick.

So, installed 8.0 on another AMD Turion64 HP Pavilion dv5210us Laptop,
it
comes the same problem -- accessing the USB hard drive causes system
panic
and reboot:

Took the previously dump/restored USB drive and mount it on this Laptop,
tried to remove the data before dump/restore, it crashed the system
after 
hit ^C and unplugged USB hard drive when the LED on USB hard drive
becomes
solid red and spiting out numbers of lines Operation not permitted 
(the user is root, so this means accessing hard drive is not possible):

rm: bin/... : Operation not permitted
..

A second try causes the system locks up After ^C.

So, try to re-partitioning the USB hard drive on AMD laptop and
dump/restore, partitioning passed, but dump/restore crashed.

Since hw.usb.umass.debug=-1 does not tell a USB problem beside the
RESET,
What other debug shall we turn on to analyze this problem.


-Original Message-
From: Guojun Jin 
Sent: Tuesday, November 24, 2009 12:13 AM
To: Guojun Jin; Hans Petter Selasky; freebsd-...@freebsd.org
Cc: b...@freebsd.org; freebsd-stable@freebsd.org
Subject: RE: 8.0-RC USB/FS problem

Freshly installed 8.0-RELEASE on two differnt machines, and USB stick
work well so far, but the USB hard drive
still has crash on this SMP (4-core AMD phenom 9600) during the
dump/restore. I will try it on the single CPU
machine tomorrow.

Re-tested dump/restore with FreeBSD 6.3/6.4 on this SMP machine and they
are working well.

Also the another strange thing ocurred during the mount a partition on
/tmp, which ended with two /tmp,
and the last one mounted is on the top (the first should be hidden):

: df
Filesystem  1K-blocks UsedAvail Capacity  Mounted on
/dev/ad0s1a756750   165484   53072624%/
devfs   110   100%/dev
/dev/ad0s2e  43194318 27833648 1190512670%/data
/dev/ad0s2d   9135182  5870390  253397870%/home
/dev/ad0s1e50763034882   432138 7%/tmp
/dev/ad0s1f  13246730  1424522 1076247012%/usr
/dev/ad0s1d   507703812700  4658176 0%/var
/dev/da0s2 661176   487660   12062280%/mnt
/dev/da1s3d   91351824  8404364 0%/dist
/dev/da1s3e  749389484 68943830 0%/tmp

: df /tmp
Filesystem  1K-blocks UsedAvail Capacity  Mounted on
/dev/da1s3e  749389484 68943830 0%/tmp

-Original Message-
From: Guojun Jin
Sent: Sun 11/22/2009 7:59 PM
To: Hans Petter Selasky; freebsd-...@freebsd.org
Cc: b...@freebsd.org; freebsd-stable@freebsd.org
Subject: RE: 8.0-RC USB/FS problem
 
From more intensive diagnose, it looks like more related USB layer.

repeated a few time on following process and ithe crash happened at
different USB access phase at each time.

dd if=/dev/zero of=/dev/da0 count=1000 bs=4k
sysinstall
partition 
 slice 1 (da0s1) 18GB ID=12
 slice 2 (da0s2) 10-15GB Id=165
 slice 3 (da0s3) rest ID=165
 W --- OK
label
 da0s3d 9GB /mnt
 da0s3e rest/dist
 W --- da0s3e  device is not configured.

w# ll /dev/da0*  # after sysinstall did partition + W at 1st time
crw-r-  1 root  operator0,  97 Nov 22 11:23 /dev/da0
crw-r-  1 root  operator0,  98 Nov 22 11:23 /dev/da0s1
crw-r-  1 root  operator0,  99 Nov 22 11:23 /dev/da0s2
crw-r-  1 root  operator0, 100 Nov 22 11:23 /dev/da0s3

# ll /dev/da0*  # after sysinstall start at 2nd time
crw-r-  1 root  operator0,  97 Nov 22 11:27 /dev/da0
System crashed

The crash log is available at
http:/www.daemonfun.com/archives/pub/USB/crash1-reset.bz2
(All logs are based on hw.usb.umass.debug=-1)

After system reboot, and repeated above processes, the da0s3e was
mounted on /dist, but da0s3d cannot.
It tunred out that newfs fail inside labeling process in sysinstall.
Manually did newfs on da0s3d, and
it cannot be mounted on /mnt, but access to it caused crash.
The crash log is available at
http:/www.daemonfun.com/archives/pub/USB/newfs

Tried entire process again, this time, both partitons are formatted
(newfs) inside labaling process (sysinstall)
but crahsed system during dump/restore on da0s3e (/dist).
The crash log is available at
http:/www.daemonfun.com/archives/pub/USB/usb-log.crash2.bz2, which is
huge one.
It contains two parts, one dump/restore IDE to da0s3d (passed), and the
rest is dump/restore to da0s3e (crashed).

I am going to reinstall the system with the new ISO from Nov 21
8.0-RELEASE to see if anything will improve.

-Original Message-
From: Hans Petter Selasky [mailto:hsela...@c2i.net]
Sent: Sun 11/22/2009 1:47 AM
To: freebsd-...@freebsd.org
Cc: Guojun Jin; b...@freebsd.org; freebsd-stable@freebsd.org
Subject: Re: 8.0-RC USB/FS problem
 
On Sunday 22 November 2009 05:38:13 Guojun Jin wrote:
 Tried on the USB hard drive

Re: 8.0-RC USB/FS problem

2009-11-22 Thread Hans Petter Selasky
On Sunday 22 November 2009 05:38:13 Guojun Jin wrote:
 Tried on the USB hard drive:

 Deleted slice 3 and recreated slice 3 with two partitions s3d and s3e.
 Was happy because successfully did dump/restore on s3d, and thought it just
 partition format issue; but system crashed during dump/restore on s3e, and
 partition lost the file system type.

 wolf# mount /dev/da0s3e /mnt
 WARNING: /mnt was not properly dismounted
 /mnt: mount pending error: blocks 35968 files 0
 wolf# fsck da0s3e
 fsck: Could not determine filesystem type
 wolf# bsdlabel da0s3
 # /dev/da0s3:
 8 partitions:
 #size   offsetfstype   [fsize bsize bps/cpg]
   c: 1757350350unused0 0 # raw part,
 don't edi t
   d: 1887436804.2BSD0 0 0
   e: 156860667 188743684.2BSD0 0 0

 Therefore, tried directly use fsck_ufs on both USB hard drive and USB stick
 to get file system clean up. All data got back now.

 The machine has run with FreeBSD 6.1 all the way to 7.2 without such
 problem. How can we determine what could go wrong in 8.0? FS or USB.

Hi,

Error 5 means IO error, so probably the transport layer, USB or lower, is to 
blame.

Some things to check:

1) Make sure the connection for your memory stick is Ok.
2) Make sure there is enough power for your memory stick.

Regarding memory sticks:

Other operating systems do a port bus reset when the device has a problem. On 
FreeBSD we just try a software reset via the control endpoint. I guess that it 
is a device problem you are seeing. The USB stack in FreeBSD is faster than 
the old one, and maybe the faster queueing of mass storage requests trigger 
some hidden bugs in your device.

When the problem happens try:

sysctl hw.usb.umass.debug=-1

--HPS
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


RE: 8.0-RC USB/FS problem

2009-11-22 Thread Guojun Jin
From more intensive diagnose, it looks like more related USB layer.

repeated a few time on following process and ithe crash happened at different 
USB access phase at each time.

dd if=/dev/zero of=/dev/da0 count=1000 bs=4k
sysinstall
partition 
 slice 1 (da0s1) 18GB ID=12
 slice 2 (da0s2) 10-15GB Id=165
 slice 3 (da0s3) rest ID=165
 W --- OK
label
 da0s3d 9GB /mnt
 da0s3e rest/dist
 W --- da0s3e  device is not configured.

w# ll /dev/da0*  # after sysinstall did partition + W at 1st time
crw-r-  1 root  operator0,  97 Nov 22 11:23 /dev/da0
crw-r-  1 root  operator0,  98 Nov 22 11:23 /dev/da0s1
crw-r-  1 root  operator0,  99 Nov 22 11:23 /dev/da0s2
crw-r-  1 root  operator0, 100 Nov 22 11:23 /dev/da0s3

# ll /dev/da0*  # after sysinstall start at 2nd time
crw-r-  1 root  operator0,  97 Nov 22 11:27 /dev/da0
System crashed

The crash log is available at 
http:/www.daemonfun.com/archives/pub/USB/crash1-reset.bz2
(All logs are based on hw.usb.umass.debug=-1)

After system reboot, and repeated above processes, the da0s3e was mounted on 
/dist, but da0s3d cannot.
It tunred out that newfs fail inside labeling process in sysinstall. Manually 
did newfs on da0s3d, and
it cannot be mounted on /mnt, but access to it caused crash.
The crash log is available at http:/www.daemonfun.com/archives/pub/USB/newfs

Tried entire process again, this time, both partitons are formatted (newfs) 
inside labaling process (sysinstall)
but crahsed system during dump/restore on da0s3e (/dist).
The crash log is available at 
http:/www.daemonfun.com/archives/pub/USB/usb-log.crash2.bz2, which is huge one.
It contains two parts, one dump/restore IDE to da0s3d (passed), and the rest is 
dump/restore to da0s3e (crashed).

I am going to reinstall the system with the new ISO from Nov 21 8.0-RELEASE to 
see if anything will improve.

-Original Message-
From: Hans Petter Selasky [mailto:hsela...@c2i.net]
Sent: Sun 11/22/2009 1:47 AM
To: freebsd-...@freebsd.org
Cc: Guojun Jin; b...@freebsd.org; freebsd-stable@freebsd.org
Subject: Re: 8.0-RC USB/FS problem
 
On Sunday 22 November 2009 05:38:13 Guojun Jin wrote:
 Tried on the USB hard drive:

 Deleted slice 3 and recreated slice 3 with two partitions s3d and s3e.
 Was happy because successfully did dump/restore on s3d, and thought it just
 partition format issue; but system crashed during dump/restore on s3e, and
 partition lost the file system type.

 wolf# mount /dev/da0s3e /mnt
 WARNING: /mnt was not properly dismounted
 /mnt: mount pending error: blocks 35968 files 0
 wolf# fsck da0s3e
 fsck: Could not determine filesystem type
 wolf# bsdlabel da0s3
 # /dev/da0s3:
 8 partitions:
 #size   offsetfstype   [fsize bsize bps/cpg]
   c: 1757350350unused0 0 # raw part,
 don't edi t
   d: 1887436804.2BSD0 0 0
   e: 156860667 188743684.2BSD0 0 0

 Therefore, tried directly use fsck_ufs on both USB hard drive and USB stick
 to get file system clean up. All data got back now.

 The machine has run with FreeBSD 6.1 all the way to 7.2 without such
 problem. How can we determine what could go wrong in 8.0? FS or USB.

Hi,

Error 5 means IO error, so probably the transport layer, USB or lower, is to 
blame.

Some things to check:

1) Make sure the connection for your memory stick is Ok.
2) Make sure there is enough power for your memory stick.

Regarding memory sticks:

Other operating systems do a port bus reset when the device has a problem. On 
FreeBSD we just try a software reset via the control endpoint. I guess that it 
is a device problem you are seeing. The USB stack in FreeBSD is faster than 
the old one, and maybe the faster queueing of mass storage requests trigger 
some hidden bugs in your device.

When the problem happens try:

sysctl hw.usb.umass.debug=-1

--HPS

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to freebsd-stable-unsubscr...@freebsd.org


Re: 8.0-RC USB/FS problem

2009-11-21 Thread Guojun Jin
Tried on the USB hard drive:

Deleted slice 3 and recreated slice 3 with two partitions s3d and s3e.
Was happy because successfully did dump/restore on s3d, and thought it just 
partition format issue;
but system crashed during dump/restore on s3e, and partition lost the file 
system type.

wolf# mount /dev/da0s3e /mnt
WARNING: /mnt was not properly dismounted
/mnt: mount pending error: blocks 35968 files 0
wolf# fsck da0s3e
fsck: Could not determine filesystem type
wolf# bsdlabel da0s3
# /dev/da0s3:
8 partitions:
#size   offsetfstype   [fsize bsize bps/cpg]
  c: 1757350350unused0 0 # raw part, don't edi
t
  d: 1887436804.2BSD0 0 0
  e: 156860667 188743684.2BSD0 0 0

Therefore, tried directly use fsck_ufs on both USB hard drive and USB stick to 
get file system
clean up. All data got back now.

The machine has run with FreeBSD 6.1 all the way to 7.2 without such problem.
How can we determine what could go wrong in 8.0? FS or USB.

By the way, IDE to IDE dump/restore seems not having such problem at this 
point, although
one of IDE drive experienced partition recognizing problem, which went away 
after deleting
slices and recreating slices.


-Original Message-
From: Guojun Jin
Sent: Sat 11/21/2009 7:40 PM
To: Hans Petter Selasky; freebsd-...@freebsd.org
Cc: freebsd-stable@freebsd.org; questi...@freebsd.org
Subject: 8.0-RC USB problem -- how to recover a damaged USB stick
 
It seems this is more serious problem in 8.0, and I hope it could be resolved 
before a formal release. I can help to diagnose this if people need more 
information (this is destructive).

I have picked a USB stick (DataTraveler 2GB), that has two partitions s0 for 
DOS and s1 for FreeBSD.
Both USB hard drive and the USB stick have worked under FreeBSD 6.2, 6.3, 6.4 
and 7.2 for a few years without any problem.

Plugged USB stick in 8.0-RC and mounted it on /mnt; then
untar a file, tarred one day ago from FreeBSD 6.3 machine onto stick,to a IDE 
drive then tar it
back to the USB stick.
During tar writting from IDE to USB stick, did ls /mnt, and tar paused and 
ls hangs.
A couple of minutes later, ls comes back, but tar still pauses.

Hit ^C on tar process around 14:30, it took another minutes to stop the 
process. Tried tar again,
and system disallowed to write on  the USB stick. ls shows all file still 
there (probably cached inods).

Went out for a few hours, and came back found /var/log/message are flooded with 
following message:
-rw-r--r--  1 root  wheel  167181 Nov 21 19:02 messages
-rw-r--r--  1 root  wheel7390 Nov 21 18:00 messages.0.bz2
-rw-r--r--  1 root  wheel7509 Nov 21 17:00 messages.1.bz2
-rw-r--r--  1 root  wheel9365 Nov 21 16:00 messages.2.bz2
-rw-r--r--  1 root  wheel   20598 Nov 21 15:00 messages.3.bz2

Nov 21 18:00:00 wolf newsyslog[2635]: logfile turned over due to size384K
Nov 21 18:00:27 wolf kernel: g_vfs_done():da0s2[WRITE(offset=625688576, length=1
31072)]error = 5
Nov 21 18:00:27 wolf kernel: g_vfs_done():da0s2[WRITE(offset=625819648, length=1
31072)]error = 5
.
Nov 21 18:19:03 wolf kernel: g_vfs_done():da0s2[WRITE(offset=524451840, length=1
6384)]error = 5
Nov 21 18:19:33 wolf kernel: g_vfs_done():da0s2[WRITE(offset=5586944, length=204
8)]error = 5
Nov 21 18:19:33 wolf kernel: g_vfs_done():da0s2[WRITE(offset=65536, length=2048)
]error = 5
Nov 21 18:19:33 wolf kernel: g_vfs_done():da0s2[WRITE(offset=114688, length=1638
4)]error = 5
Nov 21 18:20:05 wolf kernel: g_vfs_done():da0s2[WRITE(offset=349700096, length=1

and has to reboot the system, and reboot was not able to umount everything 
(boot up message):

Nov 21 18:24:03 wolf kernel: da0: Kingston DataTraveler 2.0 1.00 Removable Dir
ect Access SCSI-2 device
Nov 21 18:24:03 wolf kernel: da0: 40.000MB/s transfers
Nov 21 18:24:03 wolf kernel: da0: 1947MB (3987456 512 byte sectors: 255H 63S/T 2
48C)
Nov 21 18:24:03 wolf kernel: WARNING: / was not properly dismounted
Nov 21 18:24:03 wolf kernel: WARNING: /data was not properly dismounted
Nov 21 18:24:03 wolf kernel: WARNING: /home was not properly dismounted
Nov 21 18:24:03 wolf kernel: WARNING: /tmp was not properly dismounted
Nov 21 18:24:03 wolf kernel: WARNING: /usr was not properly dismounted
...

# mount /dev/da0s2 /mnt
mount: /dev/da0s2 : Operation not permitted

The USB stick cannot be mount under any FreeBSD OS now, and everything on the 
drive has lost.

Does anyone know if it is possible to revocer such damaged USB stick?

-Original Message-
From: Hans Petter Selasky [mailto:hsela...@c2i.net]
Sent: Wed 11/18/2009 3:13 AM
To: freebsd-...@freebsd.org
Cc: Guojun Jin; freebsd-stable@freebsd.org; questi...@freebsd.org
Subject: Re: 8.0-RC3 USB lock up on mounting two partitions from one USB drive
 
Hi,

I'm not sure if this is an USB issue or not. If you get READ/WRITE errors and 
the drive simply dies then it might be the case. Else it is a system issue.

There are quirks for mass