Re: Sparc64 rthreads Instablilty

2023-10-23 Thread Kurt Miller
I experimented with adding a nanosleep after pthread_create() to
see if that would resolve the segfault issue - it does, but it
also exposed a new failure mode on -current. Every so often
the test program would not exit now. Thinking it may be related
to the detached threads I reworked the test program to use attached
threads and coordinated shutdown of them with pthread_join(). These
changes did not affect the new issue - every so often the main thread
exits after pthread_join() has been called on the created threads and
the program occasionally gets stuck with a number of threads still being
reported to egdb/ps etc. These threads should all be gone now since
pthread_join() has been called on all of them.

Here is the updated version of the program using attached threads and
a nanosleep() work-around to the original problem along with ps and egdb
output showing an example of a stuck process after the main thread exited.

 startup.c ==
#include 
#include 
#include 

typedef struct {
long t_num;
pthread_t t_pthread_id;

/* sync startup/shutdown */
long t_state;
pthread_mutex_t t_mutex;
pthread_cond_t  t_cond_var;
} thread_t;

#define NTHREADS 40

thread_t threads[NTHREADS];

void
init_threads() {
long t_num;
for (t_num=0; t_num < NTHREADS; t_num++) {
threads[t_num].t_num = t_num;
threads[t_num].t_state = 0;
if (pthread_mutex_init([t_num].t_mutex, NULL) != 0)
err(1, "pthread_mutex_init failed");

if (pthread_cond_init([t_num].t_cond_var, NULL) != 0)
err(1, "pthread_cond_init failed");
}
}

void
complete_threads() {
long t_num;
for (t_num=0; t_num < NTHREADS; t_num++) {
pthread_mutex_lock([t_num].t_mutex);
threads[t_num].t_state = 2;
pthread_cond_broadcast([t_num].t_cond_var);
pthread_mutex_unlock([t_num].t_mutex);
}
for (t_num=0; t_num < NTHREADS; t_num++) {
if (pthread_join(threads[t_num].t_pthread_id, NULL) != 0)
err(1, "pthread_join failed");
}
}

void *
thread_start(thread_t *thread) {
pthread_mutex_lock(>t_mutex);
thread->t_state = 1;
pthread_cond_broadcast(>t_cond_var);
 
while (thread->t_state != 2)
   pthread_cond_wait(>t_cond_var, >t_mutex); 

pthread_mutex_unlock(>t_mutex);

return(NULL);
}

void
create_thread(thread_t *thread) {
int ret = pthread_create(>t_pthread_id, NULL, (void* (*)(void*)) 
thread_start, thread);
 
struct timespec timeout = { 0, 1000*1000L };
nanosleep(, NULL);

/* wait for thread startup */
pthread_mutex_lock(>t_mutex);
while (thread->t_state == 0) 
   pthread_cond_wait(>t_cond_var, >t_mutex);
pthread_mutex_unlock(>t_mutex);
}

int
main( int argc, char *argv[] )
{
long t_num;

init_threads();

/* startup threads */
for (t_num=0; t_num < NTHREADS; t_num++) {
create_thread([t_num]);
}

complete_threads();

return 0;
}
==
oracle$ ps -lp 88046
  UID   PID  PPID CPU PRI  NI   VSZ   RSS WCHAN   STAT   TT   TIME COMMAND
 1000 88046 89473   0  10   0 15400  1680 thrdeat D+ p00:00.52 ./startup
oracle$ ps -lHp 88046 
  UID   PID  PPID CPU PRI  NI   VSZ   RSS WCHAN   STAT   TT   TIME COMMAND
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.01 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.01 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 1000 88046 89473   0  10   0 15400  1680 fsleep  I+ p00:00.02 ./startup
 

Re: terminal is cleared when logging as root

2023-10-23 Thread Todd C . Miller
On Mon, 23 Oct 2023 13:16:36 -0400, Daniel Jakots wrote:

> I installed a new machine on Saturday (with -current) and I noticed
> that when I logged in as root the terminal get cleared but not cleanly.
> I upgraded a existing machine to a newer snapshot and then the problem
> appeared as well.
>
> This happens when using `doas su -`, `ssh root@` and I think I had it on
> console as well.
> For some reason, it doesn't happen with my regular user.
>
> Previous snapshot was from 2023-10-13. I guess it's since the
> libcurses update on the 17th?

This is probably caused by the tset(1) update.

 - todd



[PATCH] mg: batch mode leaves terminal in insane mode

2023-10-23 Thread Mark Willson
Hi Folks,

When mg(1) is run in batch mode (-b), at exit the terminal is left in a
non-sane state. Entering ^Jstty sane^J at the shell prompt corrects the
display. This behaviour was observed on OpenBSD 7.4.

The following patch fixes the issue:

--- main.c.orig 2023-10-23 19:07:36.007621269 +0100
+++ main.c  2023-10-23 19:08:15.622234480 +0100
@@ -167,8 +167,10 @@
ffclose(ffp, NULL);
}

-   if (batch)
+   if (batch) {
+   vttidy();
return (0);
+   }

/*
 * Now ensure any default buffer modes from the startup file are

Best Regards,
Mark
--
Mark Willson



pkg_add errors

2023-10-23 Thread Courtney Hicks

Upgraded to the latest -current snapshot.

/bsd:
    OpenBSD 7.4-current (GENERIC.MP) #1419: Mon Oct 23 10:14:12 MDT 
2023


pkg_add is currently broken. Here is the output I get:

syntax error at /usr/libdata/perl5/OpenBSD/Subst.pm line 54, near "" $v")"
Compilation failed in require at /usr/libdata/perl5/OpenBSD/State.pm 
line 73.
BEGIN failed--compilation aborted at /usr/libdata/perl5/OpenBSD/State.pm 
line 73.
Compilation failed in require at 
/usr/libdata/perl5/OpenBSD/AddCreateDelete.pm line 26.
BEGIN failed--compilation aborted at 
/usr/libdata/perl5/OpenBSD/AddCreateDelete.pm line 26.
Compilation failed in require at /usr/libdata/perl5/OpenBSD/AddDelete.pm 
line 60.
BEGIN failed--compilation aborted at 
/usr/libdata/perl5/OpenBSD/AddDelete.pm line 60.
Compilation failed in require at /usr/libdata/perl5/OpenBSD/PkgAdd.pm 
line 22.
BEGIN failed--compilation aborted at 
/usr/libdata/perl5/OpenBSD/PkgAdd.pm line 22.

Compilation failed in require at (eval 1) line 1.

Courtney



Re: terminal is cleared when logging as root

2023-10-23 Thread Hrvoje Popovski
On 23.10.2023. 19:16, Daniel Jakots wrote:
> Hi, I installed a new machine on Saturday (with -current) and I noticed
> that when I logged in as root the terminal get cleared but not cleanly.
> I upgraded a existing machine to a newer snapshot and then the problem
> appeared as well. This happens when using `doas su -`, `ssh root@` and I
> think I had it on console as well. For some reason, it doesn't happen
> with my regular user. Previous snapshot was from 2023-10-13. I guess
> it's since the libcurses update on the 17th? Cheers, Daniel

Hi,

I confirm what Daniel said over ssh and over console I'm getting this


OpenBSD/amd64 (r620-1.srce.hr) (tty01)

login: root
Password:
Last login: Mon Oct 23 10:18:24 on tty01
OpenBSD 7.4-current (GENERIC.MP) #1419: Mon Oct 23 10:14:12 MDT 2023

Welcome to OpenBSD: The proactively secure Unix-like operating system.

Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest
version of the code.  With bug reports, please try to ensure that
enough information to reproduce the problem is enclosed, and if a
known fix for it exists, include that as well.

You have mail.
F



r620-1#



when I login as user over console

OpenBSD/amd64 (r620-2.srce.hr) (tty01)

login: hrvoje
Password:
Last login: Mon Oct 23 19:55:11 on ttyp2 from 161.53.255.123
OpenBSD 7.4-current (GENERIC.MP) #1419: Mon Oct 23 10:14:12 MDT 2023

Welcome to OpenBSD: The proactively secure Unix-like operating system.

Please use the sendbug(1) utility to report bugs in the system.
Before reporting a bug, please try to reproduce it with the latest
version of the code.  With bug reports, please try to ensure that
enough information to reproduce the problem is enclosed, and if a
known fix for it exists, include that as well.

You have new mail.
r620-2$ su -
Password:
F



r620-2#



terminal is cleared when logging as root

2023-10-23 Thread Daniel Jakots
Hi,

I installed a new machine on Saturday (with -current) and I noticed
that when I logged in as root the terminal get cleared but not cleanly.
I upgraded a existing machine to a newer snapshot and then the problem
appeared as well.

This happens when using `doas su -`, `ssh root@` and I think I had it on
console as well.
For some reason, it doesn't happen with my regular user.

Previous snapshot was from 2023-10-13. I guess it's since the
libcurses update on the 17th?

Cheers,
Daniel

dmesg:
OpenBSD 7.4-current (GENERIC.MP) #1415: Fri Oct 20 10:00:26 MDT 2023
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4278042624 (4079MB)
avail mem = 4128636928 (3937MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xf59a0 (11 entries)
bios0: vendor SeaBIOS version "1.15.0-1" date 04/01/2014
bios0: QEMU Standard PC (Q35 + ICH9, 2009)
acpi0 at bios0: ACPI 3.0
acpi0: sleep states S5
acpi0: tables DSDT FACP APIC MCFG WAET
acpi0: wakeup devices
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-9700T CPU @ 2.00GHz, 312.77 MHz, 06-9e-0d
cpu0:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,VMX,SSSE3,FMA3,CX16,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,FSGSBASE,TSC_ADJUST,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,UMIP,MD_CLEAR,IBRS,IBPB,STIBP,SSBD,ARAT,IBRS_ALL,SKIP_L1DFL,MDS_NO,IF_PSCHANGE,TSX_CTRL,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu0: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 4MB
64b/line 16-way L2 cache, 16MB 64b/line 16-way L3 cache cpu0: smt 0,
core 0, package 0 mtrr: Pentium Pro MTRR support, 8 var ranges, 88
fixed ranges cpu0: apic clock running at 1000MHz cpu1 at mainbus0: apid
1 (application processor) cpu1: Intel(R) Core(TM) i7-9700T CPU @
2.00GHz, 270.19 MHz, 06-9e-0d cpu1:
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,SS,SSE3,PCLMUL,VMX,SSSE3,FMA3,CX16,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,FSGSBASE,TSC_ADJUST,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,UMIP,MD_CLEAR,IBRS,IBPB,STIBP,SSBD,ARAT,IBRS_ALL,SKIP_L1DFL,MDS_NO,IF_PSCHANGE,TSX_CTRL,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu1: 32KB 64b/line 8-way D-cache, 32KB 64b/line 8-way I-cache, 4MB
64b/line 16-way L2 cache, 16MB 64b/line 16-way L3 cache cpu1: smt 0,
core 0, package 1 ioapic0 at mainbus0: apid 0 pa 0xfec0, version
11, 24 pins acpimcfg0 at acpi0 acpimcfg0: addr 0xb000, bus 0-255
acpiprt0 at acpi0: bus 0 (PCI0)
"ACPI0006" at acpi0 not configured
acpipci0 at acpi0 PCI0: 0x0010 0x0011 0x
com0 at acpi0 COM1 addr 0x3f8/0x8 irq 4: ns16550a, 16 byte fifo
acpicmos0 at acpi0
"PNP0A06" at acpi0 not configured
"PNP0A06" at acpi0 not configured
"PNP0A06" at acpi0 not configured
"QEMU0002" at acpi0 not configured
"ACPI0010" at acpi0 not configured
acpicpu0 at acpi0: C1(@1 halt!)
acpicpu1 at acpi0: C1(@1 halt!)
pvbus0 at mainbus0: KVM
pvclock0 at pvbus0
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel 82G33 Host" rev 0x00
vga1 at pci0 dev 1 function 0 "Qumranet Virtio 1.x GPU" rev 0x01
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
ppb0 at pci0 dev 2 function 0 vendor "Red Hat", unknown product 0x000c
rev 0x00: apic 0 int 22 pci1 at ppb0 bus 1
virtio0 at pci1 dev 0 function 0 "Qumranet Virtio 1.x Network" rev 0x01
vio0 at virtio0: address 52:54:00:06:db:03
virtio0: msix per-VQ
ppb1 at pci0 dev 2 function 1 vendor "Red Hat", unknown product 0x000c
rev 0x00: apic 0 int 22 pci2 at ppb1 bus 2
xhci0 at pci2 dev 0 function 0 vendor "Red Hat", unknown product 0x000d
rev 0x01: msix, xHCI 0.0 usb0 at xhci0: USB revision 3.0
uhub0 at usb0 configuration 1 interface 0 "Red Hat xHCI root hub" rev
3.00/1.00 addr 1 ppb2 at pci0 dev 2 function 2 vendor "Red Hat",
unknown product 0x000c rev 0x00: apic 0 int 22 pci3 at ppb2 bus 3
virtio1 at pci3 dev 0 function 0 "Qumranet Virtio 1.x Console" rev 0x01
virtio1: no matching child driver; not configured
ppb3 at pci0 dev 2 function 3 vendor "Red Hat", unknown product 0x000c
rev 0x00: apic 0 int 22 pci4 at ppb3 bus 4
virtio2 at pci4 dev 0 function 0 "Qumranet Virtio 1.x Storage" rev 0x01
vioblk0 at virtio2
scsibus1 at vioblk0: 1 targets
sd0 at scsibus1 targ 0 lun 0: 
sd0: 92160MB, 512 bytes/sector, 188743680 sectors
virtio2: msix per-VQ
ppb4 at pci0 dev 2 function 4 vendor "Red Hat", unknown product 0x000c
rev 0x00: apic 0 int 22 pci5 at ppb4 bus 5
virtio3 at pci5 dev 0 function 0 vendor "Qumranet", unknown product
0x1045 rev 0x01 viomb0 at virtio3
virtio3: apic 0 int 22
ppb5 at 

Re: zotac-id89 7.4 install failure... ERROR

2023-10-23 Thread work hfelton
Apologies !!!

I had planned to work on my zotac-id89 last night, but this message and
report is regarding my apu4...

I will go back in a few hours to check for known issues with the correct
hardware...  I am so sorry for the error...

Sincerely, Harold Felton.

On Mon, Oct 23, 2023, 07:47 harold felton  wrote:

> howdee,
>
> enclosed below is the copy/paste of my sendbug temp-file...
>
> i also enclosed the boot-msgs from 7.1, 7.2, 7.3 installers...
>
> neither using a normal usb-key, nor directly booting into bsd.rd.74
> seem to work on this hardware any more...
>
> if i had to guess (looking thru upgrade-messages) - the hw is too old...
>
> at https://www.openbsd.org/plus73.html
>
>- Cleaned up multiple devices from retired architectures.
>
> looking at the 7.1 to 7.2 bsd.rd msgs i see a minor(?) line at:
>
> cpu0: ITLB 32 4KB entries fully associative, 8 4MB entries fully
> associative
> cpu0: DTLB 40 4KB entries fully associative, 8 4MB entries fully
> associative
>
> and that is all i can see/understand...
>
> thank you for your time...  sincerely, hfelton.
>
>
>


Re: Crash on TOSHIBA PORTEGE Z30-A laptop

2023-10-23 Thread wesley
> If there isn't a newer BIOS that resolves this, I would tend to return the 
> box as not suitable.



This is the case, there’s no BIOS update.

Thank you very much, anyway.

Cheers,


/Wesley

 

De : Philip Guenther  
Envoyé : lundi 23 octobre 2023 00:39
À : wes...@technicien.io
Cc : bugs@openbsd.org; m...@openbsd.org
Objet : Re: Crash on TOSHIBA PORTEGE Z30-A laptop

 

On Sat, Oct 21, 2023 at 2:27 AM mailto:wes...@technicien.io> > wrote:

Hi Philip,

Thank you very much for your answer.

I tried to disable all options (+devices) possible. Same issue.
And what's about disable acpi in the kernel using the bsd.re-config?

 

As Mike and Theo noted, this will certainly cause problems.

 

 

Do you think If I replace the wireless card by somthing else, It could resolve 
this issue?

 

Very unlikely.  The problem is the stack depth of the ACPI processing.  The 
crash you saw had the wifi interrupt occur during the ACPI processing but it 
could just as well happen with some other device interrupting the ACPI 
processing.

 

If there isn't a newer BIOS that resolves this, I would tend to return the box 
as not suitable.

 

 

Phlip Guenther