Re: svn commit: r334814 - head/sbin/dump

2018-06-09 Thread John Baldwin
On 6/8/18 10:27 AM, Justin Hibbits wrote:
> On Fri, Jun 8, 2018 at 10:08 AM, Ed Maste  wrote:
>> On 7 June 2018 at 16:49, Kirk McKusick  wrote:
>>> Author: mckusick
>>> Date: Thu Jun  7 20:49:01 2018
>>> New Revision: 334814
>>> URL: https://svnweb.freebsd.org/changeset/base/334814
>>>
>>> Log:
>>>   Ensure proper initialization of superblock.
>>>
>> ...
>>> --- head/sbin/dump/main.c   Thu Jun  7 19:57:55 2018(r334813)
>>> +++ head/sbin/dump/main.c   Thu Jun  7 20:49:01 2018(r334814)
>>> @@ -433,6 +433,7 @@ main(int argc, char *argv[])
>>> msgtail("to %s\n", tape);
>>>
>>> sync();
>>> +   sblock = NULL;
>>> if ((ret = sbget(diskfd, , -1)) != 0) {
>>
>> sblock is initialized to NULL at the beginning of ffs_sbget, so I'm
>> not really sure what's happening here.
>>
> 
> Diane just found possibly the real cause of the problem.  dump.h is
> included by almost every .c file, but defines variables, doesn't just
> declare them.  I think the real solution would be to  define them in
> main.c, or somewhere else, and just declare them in dump.h.  Or if
> they're truly only needed on a per-file basis, not as globals, they
> could be marked static so there is no chance of conflict, and they're
> pre-initialized to 0.  The linker "might" merge them into the common
> section, or might not, resulting in bizarre conflicts like what she's
> seeing.  Though, I'm surprised we're not seeing a linker error or
> warning anyway.

Is this in fact fallout from lld vs ld.bfd then?

-- 
John Baldwin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r334814 - head/sbin/dump

2018-06-08 Thread Diane Bruce
On Fri, Jun 08, 2018 at 10:08:25AM -0400, Ed Maste wrote:
> On 7 June 2018 at 16:49, Kirk McKusick  wrote:
> > Author: mckusick
> > Date: Thu Jun  7 20:49:01 2018
> > New Revision: 334814
> > URL: https://svnweb.freebsd.org/changeset/base/334814
> >
> > Log:
> >   Ensure proper initialization of superblock.
> >
> ...
> > --- head/sbin/dump/main.c   Thu Jun  7 19:57:55 2018(r334813)
> > +++ head/sbin/dump/main.c   Thu Jun  7 20:49:01 2018(r334814)
> > @@ -433,6 +433,7 @@ main(int argc, char *argv[])
> > msgtail("to %s\n", tape);
> >
> > sync();
> > +   sblock = NULL;
> > if ((ret = sbget(diskfd, , -1)) != 0) {
> 
> sblock is initialized to NULL at the beginning of ffs_sbget, so I'm

I saw that under lldb when I checked the assembler code. 

> not really sure what's happening here.

ditto. But another data point this morning. I ran stock dump
on a spinning rust portable drive I have with me today. It worked fine.
the disk in the laptop is a SSD SATA. Another data point , the 
bug failed to manifest until my system had been running a few minutes.
e.g. it did the demo mode failure when I tried to show it to jhibbits...

I will boot from the spinning rust and fsck the ssd again. @dteske
and I thoroughly fsck_ufs fsck_ffs etc. yesterday but I'll try again
today from another root disk. That's an obvious one. 


> ___
> svn-src-...@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

-- 
- d...@freebsd.org d...@db.net http://www.db.net/~db
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r334814 - head/sbin/dump

2018-06-08 Thread Justin Hibbits
On Fri, Jun 8, 2018 at 10:08 AM, Ed Maste  wrote:
> On 7 June 2018 at 16:49, Kirk McKusick  wrote:
>> Author: mckusick
>> Date: Thu Jun  7 20:49:01 2018
>> New Revision: 334814
>> URL: https://svnweb.freebsd.org/changeset/base/334814
>>
>> Log:
>>   Ensure proper initialization of superblock.
>>
> ...
>> --- head/sbin/dump/main.c   Thu Jun  7 19:57:55 2018(r334813)
>> +++ head/sbin/dump/main.c   Thu Jun  7 20:49:01 2018(r334814)
>> @@ -433,6 +433,7 @@ main(int argc, char *argv[])
>> msgtail("to %s\n", tape);
>>
>> sync();
>> +   sblock = NULL;
>> if ((ret = sbget(diskfd, , -1)) != 0) {
>
> sblock is initialized to NULL at the beginning of ffs_sbget, so I'm
> not really sure what's happening here.
>

Diane just found possibly the real cause of the problem.  dump.h is
included by almost every .c file, but defines variables, doesn't just
declare them.  I think the real solution would be to  define them in
main.c, or somewhere else, and just declare them in dump.h.  Or if
they're truly only needed on a per-file basis, not as globals, they
could be marked static so there is no chance of conflict, and they're
pre-initialized to 0.  The linker "might" merge them into the common
section, or might not, resulting in bizarre conflicts like what she's
seeing.  Though, I'm surprised we're not seeing a linker error or
warning anyway.

- Justin
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r334814 - head/sbin/dump

2018-06-08 Thread Ed Maste
On 7 June 2018 at 16:49, Kirk McKusick  wrote:
> Author: mckusick
> Date: Thu Jun  7 20:49:01 2018
> New Revision: 334814
> URL: https://svnweb.freebsd.org/changeset/base/334814
>
> Log:
>   Ensure proper initialization of superblock.
>
...
> --- head/sbin/dump/main.c   Thu Jun  7 19:57:55 2018(r334813)
> +++ head/sbin/dump/main.c   Thu Jun  7 20:49:01 2018(r334814)
> @@ -433,6 +433,7 @@ main(int argc, char *argv[])
> msgtail("to %s\n", tape);
>
> sync();
> +   sblock = NULL;
> if ((ret = sbget(diskfd, , -1)) != 0) {

sblock is initialized to NULL at the beginning of ffs_sbget, so I'm
not really sure what's happening here.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r334814 - head/sbin/dump

2018-06-07 Thread Kirk McKusick
Author: mckusick
Date: Thu Jun  7 20:49:01 2018
New Revision: 334814
URL: https://svnweb.freebsd.org/changeset/base/334814

Log:
  Ensure proper initialization of superblock.
  
  Submitted by: Diane Bruce

Modified:
  head/sbin/dump/main.c

Modified: head/sbin/dump/main.c
==
--- head/sbin/dump/main.c   Thu Jun  7 19:57:55 2018(r334813)
+++ head/sbin/dump/main.c   Thu Jun  7 20:49:01 2018(r334814)
@@ -433,6 +433,7 @@ main(int argc, char *argv[])
msgtail("to %s\n", tape);
 
sync();
+   sblock = NULL;
if ((ret = sbget(diskfd, , -1)) != 0) {
switch (ret) {
case ENOENT:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"