kgdb crashing on a vmcore with dumptid = 0

2018-05-04 Thread Eitan Adler
gdb$ bt
#0  thr_kill () at thr_kill.S:3
#1  0x0008035046b4 in __raise (s=0x6) at /usr/src/lib/libc/gen/raise.c:54
#2  0x000803504629 in abort () at /usr/src/lib/libc/stdlib/abort.c:67
#3  0x00c805c6 in dump_core () at utils.c:284
#4  0x00c81920 in internal_vproblem (problem=0x24bd890
, file=0x15c560e "inferior.c", line=0x135,
fmt=0x15780ac "%s: Assertion
 `%s' failed.", ap=0x7fffb9e0) at utils.c:493
#5  0x00c806d8 in internal_verror (file=0x15c560e
"inferior.c", line=0x135, fmt=0x15780ac "%s: Assertion `%s' failed.",
ap=0x7fffb9e0) at utils.c:
518
#6  0x008363a8 in internal_error (file=0x15c560e "inferior.c",
line=0x135, fmt=0x15780ac "%s: Assertion `%s' failed.") at
common/errors.c:55
#7  0x00a8397e in find_inferior_pid (pid=0x0) at inferior.c:309
#8  0x00a83d54 in find_inferior_ptid (ptid=...) at inferior.c:323
#9  0x00c10049 in default_thread_architecture (ops=0x2702d90
, ptid=...) at target.c:3131
#10 0x00bfec2b in delegate_thread_architecture (self=0x2702d90
, arg1=...) at ./target-delegates.c:2525
#11 0x00bfec2b in delegate_thread_architecture (self=0x26eedd0
, arg1=...) at ./target-delegates.c:2525
#12 0x00bfec2b in delegate_thread_architecture (self=0x26ec280
, arg1=...) at ./target-delegates.c:2525
#13 0x00b53cba in get_thread_regcache (ptid=...) at regcache.c:439
#14 0x00b53d5e in get_current_regcache () at regcache.c:448
#15 0x00713077 in kgdb_trgt_open (arg=0x80410900e "vmcore.2",
from_tty=0x1) at fbsd-kvm.c:335
#16 0x00bf3980 in open_target (args=0x80410900e "vmcore.2",
from_tty=0x1, command=0x8041c8f40) at target.c:356
#17 0x00722c35 in do_sfunc (c=0x8041c8f40, args=0x80410900e
"vmcore.2", from_tty=0x1) at cli/cli-decode.c:122
#18 0x00726b5a in cmd_func (cmd=0x8041c8f40, args=0x80410900e
"vmcore.2", from_tty=0x1) at cli/cli-decode.c:1886
#19 0x00c450c7 in execute_command (p=0x804109015 "2",
from_tty=0x1) at top.c:630
#20 0x00acd4a8 in catch_command_errors (command=0xc445f0
, arg=0x804109000 "target vmcore
vmcore.2", from_tty=0x1)
at main.c:378
#21 0x00accdf2 in captured_main_1 (context=0x7fffcfe8) at
main.c:1124
#22 0x00aca62d in captured_main (data=0x7fffcfe8) at main.c:1146
#23 0x00aca508 in gdb_main (args=0x7fffcfe8) at main.c:1172
#24 0x0050bd5b in main (argc=0x3, argv=0x7fffd558) at
kgdb-main.c:410

gdb$ up 7
#7  0x00a8397e in find_inferior_pid (pid=0x0) at inferior.c:309
309   gdb_assert (pid != 0);
gdb$ frame
Stack level 7, frame at 0x7fffba50:
 rip = 0xa8397e in find_inferior_pid (inferior.c:309); saved rip = 0xa83d54
 called by frame at 0x7fffba60, caller of frame at 0x7fffba20
 source language c++.
 Arglist at 0x7fffba40, args: pid=0x0
 Locals at 0x7fffba40, Previous frame's sp is 0x7fffba50
 Saved registers:
  rbp at 0x7fffba40, rip at 0x7fffba48
pid = 0x0
inf = 0x8415d5 


gdb$ list
304   struct inferior *inf;
305
306   /* Looking for inferior pid == 0 is always wrong, and indicative of
307  a bug somewhere else.  There may be more than one with pid == 0,
308  for instance.  */
309   gdb_assert (pid != 0);
310
311   for (inf = inferior_list; inf; inf = inf->next)
312 if (inf->pid == pid)
313   return inf;


gdb$ p pid
$1 = 0x0


gdb$ p ptid
$2 = {
  m_pid = 0x0,
  m_lwp = 0x0,
  m_tid = 0x0
}

gdb$ up
#9  0x00c10049 in default_thread_architecture (ops=0x2702d90
, ptid=...) at target.c:3131
3131  inferior *inf = find_inferior_ptid (ptid);
gdb$ list
3126}
3127
3128static struct gdbarch *
3129default_thread_architecture (struct target_ops *ops, ptid_t ptid)
3130{
3131  inferior *inf = find_inferior_ptid (ptid);
3132  gdb_assert (inf != NULL);
3133  return inf->gdbarch;
3134}
3135
gdb$ p ops
$4 = (target_ops *) 0x2702d90 

gdb$ up
#14 0x00b53d5e in get_current_regcache () at regcache.c:448
448   return get_thread_regcache (inferior_ptid);
gdb$ list
443 }
444
445 struct regcache *
446 get_current_regcache (void)
447 {
448   return get_thread_regcache (inferior_ptid);
449 }
450
451 /* See common/common-regcache.h.  */
452
gdb$ p inferior_ptid
$13 = {
  m_pid = 0x0,
  m_lwp = 0x0,
  m_tid = 0x0
}


gdb$ up
#15 0x00713077 in kgdb_trgt_open (arg=0x80410900e "vmcore.2",
from_tty=0x1) at fbsd-kvm.c:335
335 target_fetch_registers (get_current_regcache (), -1);
gdb$ list
330 kt = kgdb_thr_next(kt);
331 }
332 if (curkthr != 0)
333 inferior_ptid = fbsd_vmcore_ptid(curkthr->tid);
334
335 target_fetch_registers (get_current_regcache (), -1);
336
337 reinit_frame_cache ();
338 print_stack_frame (get_selected_frame (NULL), 0,
SRC_AND_LOC, 

SSP_CFLAGS for kernel

2018-05-04 Thread Rozhuk Ivan
Hi!

I set:

/etc/src.conf:
WITH_SSP=

/etc/make.conf:
SSP_CFLAGS=-fstack-protector-all
WITH_SSP_PORTS=yes


But in /usr/src/sys/conf/kern.mk:

...
#
# GCC SSP support
#
.if ${MK_SSP} != "no" && \
${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
CFLAGS+=-fstack-protector
.endif
...


Is there should be some thing like in /usr/src/share/mk/bsd.sys.mk:

SSP_CFLAGS?=-fstack-protector
CFLAGS+=${SSP_CFLAGS}

???


PS: /usr/ports/UPDATING
"The default SSP_CLFAGS is -fstack-protector, but -fstack-protector-all"
should be:
"The default SSP_CFLAGS is -fstack-protector, but -fstack-protector-all"
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Recent warnings.

2018-05-04 Thread Sean Bruno
make[3]: "/usr/src/share/mk/bsd.prog.mk" line 274: warning: duplicate
script for target "_scriptsinstall" ignored
make[3]: "/usr/src/share/mk/bsd.prog.mk" line 274: warning: using
previous script for "_scriptsinstall" defined here


This popped up on me this week.  Anyone see what's going on?

sean



signature.asc
Description: OpenPGP digital signature


Re: OSVERSION

2018-05-04 Thread Jeffrey Bouquet


On Fri, 4 May 2018 15:28:53 -0600, Alan Somers  wrote:

> On Fri, May 4, 2018 at 2:46 PM, Jeffrey Bouquet 
> wrote:
> 
> > 12.0-CURRENT r332797 GENERIC amd64
> > ..
> > make: "/usr/ports/Mk/bsd.port.mk" line 1171: Unable to
> > determine OS version. Either define OSVERSION, or
> > install /usr/include/sys/param.h...
> > ..
> > then , with param.h in place
> >
> > ..
> > port builds, pkgdb -u, and  portsdb -u all fail with:
> > ..
> > line 1200: UNAME_r (12.0-CURRENT) and OSVERSION (12.0-CURRENT) do not agree
> > on major version number.
> > ..
> > Can I set that in sh or tcsh or zsh?
> > .
> >
> 
> Looks like you're running ports in a jail.  The best way to do that is to
> set OSVERSION in /etc/make.conf.  Some jail managers will even do that for
> you.  It should look a little like this:
> 
>  > cat /etc/make.conf
> OSVERSION+=1100122
> UNAME_ENV+= OSVERSION=${OSVERSION}
> UNAME_ENV+= UNAME_s=FreeBSD
> UNAME_ENV+= UNAME_r=11.0-RELEASE
> UNAME_ENV+= UNAME_v="${UNAME_s} ${UNAME_r}"
> .MAKEFLAGS: ${UNAME_ENV}
> MAKE_ENV+=  ${UNAME_ENV}
> CONFIGURE_ENV+= ${UNAME_ENV}
> SCRIPTS_ENV+=   ${UNAME_ENV}
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


uname -K plugged into that template fixed the port error message. 
Thanks! 
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: OSVERSION

2018-05-04 Thread Ian Lepore
On Fri, 2018-05-04 at 15:28 -0600, Alan Somers wrote:
> On Fri, May 4, 2018 at 2:46 PM, Jeffrey Bouquet 
> wrote:
> 
> > 
> > 12.0-CURRENT r332797 GENERIC amd64
> > ..
> > make: "/usr/ports/Mk/bsd.port.mk" line 1171: Unable to
> > determine OS version. Either define OSVERSION, or
> > install /usr/include/sys/param.h...
> > ..
> > then , with param.h in place
> > 
> > ..
> > port builds, pkgdb -u, and  portsdb -u all fail with:
> > ..
> > line 1200: UNAME_r (12.0-CURRENT) and OSVERSION (12.0-CURRENT) do not agree
> > on major version number.
> > ..
> > Can I set that in sh or tcsh or zsh?
> > .
> > 
> Looks like you're running ports in a jail.  The best way to do that is to
> set OSVERSION in /etc/make.conf.  Some jail managers will even do that for
> you.  It should look a little like this:
> 
>  > cat /etc/make.conf
> OSVERSION+=1100122
> UNAME_ENV+= OSVERSION=${OSVERSION}
> UNAME_ENV+= UNAME_s=FreeBSD
> UNAME_ENV+= UNAME_r=11.0-RELEASE
> UNAME_ENV+= UNAME_v="${UNAME_s} ${UNAME_r}"
> .MAKEFLAGS: ${UNAME_ENV}
> MAKE_ENV+=  ${UNAME_ENV}
> CONFIGURE_ENV+= ${UNAME_ENV}
> SCRIPTS_ENV+=   ${UNAME_ENV}

If you're running a freebsd 11 jail on a freebsd 12 host, the best
solution is to set osrelease and osreldate in your jail config to
reflect the 11.x userland you want the jail to implement. Then all the
values returned by uname and various sysctls will be consistently
correct within the jail. For example, on a 10.3 host I have a jail:

fb8 {
host.hostname = "${name}.hippie.lan";
ip4.addr = 172.22.42.241;
persist = true;
devfs_ruleset = 100;
osrelease="8.4-STABLE";
osreldate= 804507;
}

-- Ian
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: OSVERSION

2018-05-04 Thread Alan Somers
On Fri, May 4, 2018 at 2:46 PM, Jeffrey Bouquet 
wrote:

> 12.0-CURRENT r332797 GENERIC amd64
> ..
> make: "/usr/ports/Mk/bsd.port.mk" line 1171: Unable to
> determine OS version. Either define OSVERSION, or
> install /usr/include/sys/param.h...
> ..
> then , with param.h in place
>
> ..
> port builds, pkgdb -u, and  portsdb -u all fail with:
> ..
> line 1200: UNAME_r (12.0-CURRENT) and OSVERSION (12.0-CURRENT) do not agree
> on major version number.
> ..
> Can I set that in sh or tcsh or zsh?
> .
>

Looks like you're running ports in a jail.  The best way to do that is to
set OSVERSION in /etc/make.conf.  Some jail managers will even do that for
you.  It should look a little like this:

 > cat /etc/make.conf
OSVERSION+=1100122
UNAME_ENV+= OSVERSION=${OSVERSION}
UNAME_ENV+= UNAME_s=FreeBSD
UNAME_ENV+= UNAME_r=11.0-RELEASE
UNAME_ENV+= UNAME_v="${UNAME_s} ${UNAME_r}"
.MAKEFLAGS: ${UNAME_ENV}
MAKE_ENV+=  ${UNAME_ENV}
CONFIGURE_ENV+= ${UNAME_ENV}
SCRIPTS_ENV+=   ${UNAME_ENV}
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


OSVERSION

2018-05-04 Thread Jeffrey Bouquet
12.0-CURRENT r332797 GENERIC amd64
..
make: "/usr/ports/Mk/bsd.port.mk" line 1171: Unable to
determine OS version. Either define OSVERSION, or 
install /usr/include/sys/param.h...
..
then , with param.h in place 

..
port builds, pkgdb -u, and  portsdb -u all fail with: 
..
line 1200: UNAME_r (12.0-CURRENT) and OSVERSION (12.0-CURRENT) do not agree
on major version number.  
..
Can I set that in sh or tcsh or zsh? 
.
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Regression Resume Lenovo T450

2018-05-04 Thread Pete Wright



On 05/03/2018 23:07, Manuel Stühn wrote:


Since some time now CURRENT runs very smoothly on my Lenovo T450 in 
conjunction with drm-stable-kmod installed. WLAN, Suspense 
worked out of the box (at least ... until now). Due to pkg(8) 
complaining about wrong ABI of packages, I've made an update from 
r332385 (1200061) to r333091 (1200062), and now the T450 does not 
resume anymore; i have to hold the power button for some time to power 
it down. The ZFS-Boot-Environment I've made beforehand updating is 
still capable of resuming.


I tried to find out which commit broke the resume for me by installing 
older kernels, but even installing r332385 kernel (into the actual 
r333091 userland) does not restore its capability to resume.


Any ideas or hints? Which information can i provide to help 
investigating this matter?


have you tried suspend/resume without having the drm-next kmod loaded?  
I have run into a couple instances of that breaking due to drm-next.


if it does work w/o drm-next then it might be worth rebuilding the pkg 
locally (via "cd /usr/ports/graphics/drm-next-kmod && make package" for 
example) and see if that fixes it.


there is also a sysctl knob i've set in the past to help in this area, 
i'll dig through my notes and see if i can find it...


-pete

--
Pete Wright
p...@nomadlogic.org
@nomadlogicLA

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


Regression Resume Lenovo T450

2018-05-04 Thread Manuel Stühn


Since some time now CURRENT runs very smoothly on my Lenovo T450 in 
conjunction with drm-stable-kmod installed. WLAN, Suspense worked 
out of the box (at least ... until now). Due to pkg(8) complaining about 
wrong ABI of packages, I've made an update from r332385 (1200061) to 
r333091 (1200062), and now the T450 does not resume anymore; i have to 
hold the power button for some time to power it down. The 
ZFS-Boot-Environment I've made beforehand updating is still capable of 
resuming.


I tried to find out which commit broke the resume for me by installing 
older kernels, but even installing r332385 kernel (into the actual 
r333091 userland) does not restore its capability to resume.


Any ideas or hints? Which information can i provide to help 
investigating this matter?


-- Manuel 
___

freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"