Re: Crash on TOSHIBA PORTEGE Z30-A laptop

2023-10-21 Thread Theo de Raadt
Mike Larkin  wrote:

> On Sat, Oct 21, 2023 at 01:27:21PM +0400, 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?
> >
> 
> Not advisable. You'll probably end up causing even more problems.


You mean, like

> disable acpi*

Meaning, using a glob, which is a lot like a regular expression.

Are you not aware of the wise words on the internet about 'and now you
have two problems'?


Anytime anyone says 'disable acpi', they should be corrected.  The
correct command is 'disable pci'.  Trust me.



Re: Limiting RAM on boot to emulate low-memory situation

2023-10-21 Thread Mike Larkin
On Sat, Oct 21, 2023 at 10:22:45AM -, Stuart Henderson wrote:
> On 2023-10-21, Chris Narkiewicz  wrote:
> > Is it possible to decrease amount of available RAM at boot time?
> >
> > I'm about to migrate some VPS system to a significantly cheaper option
> > that comes with less RAM and I need to evaluate how existing system
> > will behave.
> >
> > Sadly, I can't reconfigure RAM in VPS config.
>
> At least for x86, see "machine mem" in boot(8).
>
> --
> Please keep replies on the mailing list.
>

While mach mem in boot> will work for BIOS based machines, it does not work
in EFI (or at least it didn't, last time I checked). FYI.



Re: Crash on TOSHIBA PORTEGE Z30-A laptop

2023-10-21 Thread Mike Larkin
On Sat, Oct 21, 2023 at 01:27:21PM +0400, 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?
>

Not advisable. You'll probably end up causing even more problems.

> Do you think If I replace the wireless card by somthing else, It could 
> resolve this issue?
>
>
> /Wesley
>
>
>
> -Message d'origine-
> De : owner-b...@openbsd.org  De la part de Philip 
> Guenther
> Envoyé : samedi 21 octobre 2023 03:23
> À : wes...@technicien.io
> Cc : b...@openbsd.org; misc@openbsd.org
> Objet : Re: Crash on TOSHIBA PORTEGE Z30-A laptop
>
> On Fri, Oct 20, 2023 at 1:23 PM  wrote:
>
> > I've recently installed OpenBSD 7.4 on this laptop.
> >
> > However, I'm experiencing random crashes. These occur at various
> > times, including during kernel loading (before running /etc/rc),
> >
> > or later while I'm using the system.
> >
> >
> > I've included the contents of /var/run/dmesg.boot below and attached
> > the screens with the ddb output command.
> >
> ...
>
> > bios0: vendor TOSHIBA version "Version 4.30" date 04/26/2018
> >
>
> The screenshots show that the fault happens during a wifi interrupt that 
> catches the ACPI thread processing a very deeply nested AML code.  I suspect 
> it's actually running out of kernel stack space as a result.
> Everything below is based on that hypothesis.
>
> So, the first thing to try is to see if there's a BIOS update newer than the 
> 2018 rev it currently has.  They may have optimized the AML code, or at least 
> made it less deeply nested.
>
> Another possibility is to see if there's a device you can disable that would 
> result in that AML not being called.  If there's anything that you aren't 
> using then disable it in the BIOS and hope.
>
> The last possibility would be to build a kernel which allocates more pages 
> per thread for its kernel stack by bumping the UPAGES #define in 
> /usr/src/sys/arch/amd64/include/param.h and building a new kernel.  It's 
> really only the ACPI thread that needs this, but we don't currently have code 
> to control that on a per-thread basis.
>
>
> Philip Guenther
>



Re: relayd and large POST requests

2023-10-21 Thread Daniele B.


Actually I can't be sure this the origin of your problem, but the value
of "memory_limit" is wrong.

>From the doc:
https://www.php.net/manual/en/ini.core.php#ini.post-max-size

post_max_size int
  Sets max size of post data allowed. This setting also affects file
  upload. To upload large files, this value must be larger than
  upload_max_filesize. Generally speaking, memory_limit should be larger
  than post_max_size. When an int is used, the value is measured in
  bytes. Shorthand notation, as described in this FAQ, may also be used

doc for memory_limit:
https://www.php.net/manual/en/ini.core.php#ini.memory-limit

Take it like one more hint but I personally gave up with *shorthand
notation* specifying the value of all these php settings. If you go to
complete your php app with a javascript checking your php config the
shorthand notation read by ini_gets makes soon fail your javascripts.


Erwin Geerdink  wrote:

> php.ini:
> 
> upload_max_filesize = 4096M
> post_max_size = 4096M
> memory_limit = 256M
> max_execution_time = 300



Re: relayd and large POST requests

2023-10-21 Thread Erwin Geerdink
> Can you post from your php.ini what you did set for the following
> values?

php.ini:

upload_max_filesize = 4096M
post_max_size = 4096M
memory_limit = 256M
max_execution_time = 300

httpd.conf:

connection {
max request body 4294967296  # 4096M
}

I'm able to reproduce the problem locally with identical setup.
Transfer is then a matter of seconds and timeout should not be an issue.
Uploading a 3000M file with increased login.conf limits succeeds, 
but sometimes results in very high memory consumption first by relayd
and then followed by httpd, as observed with top:

  PID USERNAME PRI NICE  SIZE   RES STATE WAIT  TIMECPU COMMAND
56119 _relayd20 8198M 7117M sleep/1   kqread0:20 25.78% relayd
15048 www20 4101M 4105M sleep/3   kqread0:32 24.71% httpd

As mentioned, other times relayd's memory usage just remains low (few Mb) 
while the data is passed on to varnish/httpd (which does have increased 
memory usage while flushing the data to disk)

Kind regards,
Erwin




openbsd-current on yandex cloud

2023-10-21 Thread Mikhail
I'm trying to start openbsd on yandex cloud, it starts fine, but hangs
in the boot process.

I tried

boot -d
w db_console 1
c
ctrl-alt-esc

But the keypress doesn't bring me into debugger.

Any recommendations on how to debug this stuff?

Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2023 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 7.4-current (GENERIC) #1353: Fri Oct 20 09:50:25 MDT 2023
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
real mem = 2130558976 (2031MB)
avail mem = 2046406656 (1951MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xf5780 (10 entries)
bios0: vendor SeaBIOS version "1.16.1-1" date 04/01/2014
bios0: Yandex xeon-gold-6338
acpi0 at bios0: ACPI 3.0
acpi0: sleep states S3 S4 S5
acpi0: tables DSDT FACP APIC HPET SRAT MCFG
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 Xeon Processor (Icelake), 1995.43 MHz, 06-6a-00
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,SSSE3,FMA3,CX16,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,AVX512F,AVX512DQ,RDSEED,ADX,SMAP,AVX512IFMA,CLFLUSHOPT,CLWB,AVX512CD,SHA,AVX512BW,AVX512VL,AVX512VBMI,UMIP,PKU,MD_CLEAR,IBRS,IBPB,STIBP,SSBD,ARAT,IBRS_ALL,SKIP_L1DFL,MDS_NO,IF_PSCHANGE,XSAVEOPT,XSAVEC,XGETBV1
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
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 0 pa 0xfec0, version 11, 24 pins
acpihpet0 at acpi0: 1 Hz
acpimcfg0 at acpi0
acpimcfg0: addr 0xb000, bus 0-255
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 137 (PC89)
acpiprt2 at acpi0: bus 128 (PC80)
"ACPI0006" at acpi0 not configured
acpipci0 at acpi0 PCI0: 0x 0x0011 0x0001
acpicmos0 at acpi0
com0 at acpi0 COM1 addr 0x3f8/0x8 irq 4: ns16550a, 16 byte fifo
com0: console
com1 at acpi0 COM2 addr 0x2f8/0x8 irq 3: ns16550a, 16 byte fifo
com2 at acpi0 COM3 addr 0x3e8/0x8 irq 6: ns16550a, 16 byte fifo
com3 at acpi0 COM4 addr 0x2e8/0x8 irq 7: ns16550a, 16 byte fifo
"PNP0A06" at acpi0 not configured
"PNP0A06" at acpi0 not configured
"QEMU0002" at acpi0 not configured
"ACPI0010" at acpi0 not configured
acpipci1 at acpi0 PC89: 0x 0x0011 0x0001
acpipci2 at acpi0 PC80: 0x 0x0011 0x0001
acpicpu0 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 "Bochs VGA" rev 0x02
wsdisplay at vga1 not configured
ehci0 at pci0 dev 2 function 0 "Intel 82801DB USB" rev 0x10: apic 0 int 21
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00 
addr 1
pchb1 at pci0 dev 3 function 0 vendor "Red Hat", unknown product 0x000b rev 0x00
pchb2 at pci0 dev 4 function 0 vendor "Red Hat", unknown product 0x000b rev 0x00
pcib0 at pci0 dev 31 function 0 "Intel 82801IB LPC" rev 0x02
ichiic0 at pci0 dev 31 function 3 "Intel 82801I SMBus" rev 0x02: apic 0 int 16
iic0 at ichiic0
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0 mux 1
pms0 at pckbc0 (aux slot)
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
pci1 at mainbus0 bus 137
ppb0 at pci1 dev 0 function 0 vendor "Red Hat", unknown product 0x000c rev 
0x00: apic 0 int 11
pci2 at ppb0 bus 138
virtio0 at pci2 dev 0 function 0 "Qumranet Virtio Network" rev 0x00
vio0 at virtio0: address d0:0d:17:f6:1c:cf
virtio0: msix per-VQ
ppb1 at pci1 dev 1 function 0 vendor "Red Hat", unknown product 0x000c rev 
0x00: apic 0 int 10
pci3 at ppb1 bus 139
ppb2 at pci1 dev 2 function 0 vendor "Red Hat", unknown product 0x000c rev 
0x00: apic 0 int 10
pci4 at ppb2 bus 140
ppb3 at pci1 dev 3 function 0 vendor "Red Hat", unknown product 0x000c rev 
0x00: apic 0 int 11
pci5 at ppb3 bus 141
ppb4 at pci1 dev 4 function 0 vendor "Red Hat", unknown product 0x000c rev 
0x00: apic 0 int 11
pci6 at ppb4 bus 142
ppb5 at pci1 dev 5 function 0 vendor "Red Hat", unknown product 0x000c rev 
0x00: apic 0 int 10
pci7 at ppb5 bus 143
ppb6 at pci1 dev 6 function 0 vendor "Red Hat", unknown product 0x000c rev 
0x00: apic 0 int 10
pci8 at ppb6 bus 144
ppb7 at pci1 dev 7 function 0 vendor "Red Hat", unknown product 0x000c rev 
0x00: apic 0 int 11
pci9 at ppb7 bus 145
pci10 at mainbus0 bus 128
ppb8 at pci10 dev 0 function 0 vendor "Red 

Re: relayd and large POST requests

2023-10-21 Thread Daniele B.



Can you post from your php.ini what you did set for the following values?

upload_max_filesize =
post_max_size =
memory_limit =

Despite the allocation memory problem (from the error message) I would also 
suggest you
to double check %request timeout% settings starting from php.ini:

max_execution_time =

to end to varnish (passing by httpd).

-- Daniele Bonini



Erwin Geerdink  wrote:

> *occassionally*
> 
> relayd[572]: relay mysite4, session 14 (1 active),
> 0, xxx -> 127.0.0.1:8443, Cannot allocate memory (500 Internal
> Server Error), POST: Undefined error: 0
> 
> There is no temporary file created in /var/www/tmp.



relayd and large POST requests

2023-10-21 Thread Erwin Geerdink
Hi,

I'm running a setup on OpenBSD 7.3 (amd64, 16GB RAM) with relayd,
varnish, httpd and php-fpm. When uploading a large >2GB file through
our web application, *occassionally* relayd starts to consume an
increasing amount of memory (as observed with top) until it hits
resource limits from login.conf and the file upload terminates
prematurely. In /var/log/daemon:

relayd[572]: relay mysite4, session 14 (1 active),
0, xxx -> 127.0.0.1:8443, Cannot allocate memory (500 Internal
Server Error), POST: Undefined error: 0

There is no temporary file created in /var/www/tmp. 

*Sometimes* the upload does succeed, in that case memory usage of
relayd remains low and the data is being flushed to disk (a growing
temporary file in /var/www/tmp).

File uploads appear to work fine when relayd is taken out of
the loop. Obviously I could tweak login.conf, but the high memory
consumption (although temporary) may also cause other problems.

Why does relayd sometimes buffer "the whole file" in memory? Can this be
configured somehow?

Possibly related but very old, no solution:
https://marc.info/?l=openbsd-misc=132588522002336=2


Kind regards,
Erwin


/etc/relayd.conf:

table  { 127.0.0.1 }

log connection

http protocol "https" {
tls keypair "server"
return error
pass
}

relay "mysite4" {
listen on xxx port 443 tls
protocol "https"
forward to  port 8443 check tcp
}



Re: SSL issues after upgrading from 7.3 to 7.4

2023-10-21 Thread Theo Buehler
On Sat, Oct 21, 2023 at 09:23:51AM +0300, Mark wrote:
> So, no idea on this?

No. OCSP does work for me on 7.4 when enabled, both with httpd and nginx.
With nginx, you need to have accessed the page at least once so it
fetches and caches the staple and that may depend on the per worker
process.

I see no fundamental issues in my testing and this was confirmed
independently by others who have various setups with various CAs.

For example doing

$ nc -cvz www.openbsd.org 443

will show good OCSP stapling. Similar with

$ openssl s_client -status -connect www.openbsd.org:443

on several OS with various openssl variants. So there are no SSL issues
per se.

> There are people having similar SSL issues (have been reading about them in
> IRC channels)

I take your word for it. No actionable bug report reached the relevant
mailing lists.

A minimal, known working configuration with 7.3 that stops working with
7.4 will probably help.



Re: squid replacement

2023-10-21 Thread Stuart Henderson
On 2023-10-20, Lyndon Nerenberg (VE7TFX/VE6BBM)  wrote:
> We've been running squid on OpenBSD for years, but it seems these
> days that any time it tries to proxy a file > 1MB, it just dies.
> This makes it impossible to do thinks like mirror the OpenBSD
> distributions.
>
> Does anyone know of another HTTP proxy that supports squid-style
> ACLs?  That's a big part of why we chose it in the first place.  We
> restrict which hosts can connect to the proxy, and further restrict
> which hosts they can connect to upstream.  We don't need (or want)
> caching -- just connection pass through.
> 
> I've been looking for a while but haven't found anything with
> equivalent ACL support.  Anybody out there have suggestions for a
> likely candidate?

Perhaps Apache httpd with mod_proxy can do what you want.
No problems with Squid with >1MB files here though...



Re: Limiting RAM on boot to emulate low-memory situation

2023-10-21 Thread Stuart Henderson
On 2023-10-21, Chris Narkiewicz  wrote:
> Is it possible to decrease amount of available RAM at boot time?
>
> I'm about to migrate some VPS system to a significantly cheaper option
> that comes with less RAM and I need to evaluate how existing system
> will behave.
>
> Sadly, I can't reconfigure RAM in VPS config.

At least for x86, see "machine mem" in boot(8).

-- 
Please keep replies on the mailing list.



Re: Crash on TOSHIBA PORTEGE Z30-A laptop

2023-10-21 Thread wesley
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?

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


/Wesley 



-Message d'origine-
De : owner-b...@openbsd.org  De la part de Philip 
Guenther
Envoyé : samedi 21 octobre 2023 03:23
À : wes...@technicien.io
Cc : b...@openbsd.org; misc@openbsd.org
Objet : Re: Crash on TOSHIBA PORTEGE Z30-A laptop

On Fri, Oct 20, 2023 at 1:23 PM  wrote:

> I've recently installed OpenBSD 7.4 on this laptop.
>
> However, I'm experiencing random crashes. These occur at various 
> times, including during kernel loading (before running /etc/rc),
>
> or later while I'm using the system.
>
>
> I've included the contents of /var/run/dmesg.boot below and attached 
> the screens with the ddb output command.
>
...

> bios0: vendor TOSHIBA version "Version 4.30" date 04/26/2018
>

The screenshots show that the fault happens during a wifi interrupt that 
catches the ACPI thread processing a very deeply nested AML code.  I suspect 
it's actually running out of kernel stack space as a result.
Everything below is based on that hypothesis.

So, the first thing to try is to see if there's a BIOS update newer than the 
2018 rev it currently has.  They may have optimized the AML code, or at least 
made it less deeply nested.

Another possibility is to see if there's a device you can disable that would 
result in that AML not being called.  If there's anything that you aren't using 
then disable it in the BIOS and hope.

The last possibility would be to build a kernel which allocates more pages per 
thread for its kernel stack by bumping the UPAGES #define in 
/usr/src/sys/arch/amd64/include/param.h and building a new kernel.  It's really 
only the ACPI thread that needs this, but we don't currently have code to 
control that on a per-thread basis.


Philip Guenther



Re: SSL issues after upgrading from 7.3 to 7.4

2023-10-21 Thread Daniele B.


Do you mind to post your nginx ssl configuration together with your
resolver directive?

-- Daniele Bonini


Mark  wrote:

> > "SERVER DOES NOT SUPPORT OCSP STAPLING" after the upgrade.
> >
> > However, again, OCSP stapling is implemented correctly in my
> > nginx.conf file, working since a year.



Re: kate no longer start after upgrade to 7.4

2023-10-21 Thread Federico Giannici

On 10/20/23 19:31, Federico Giannici wrote:
I just upgraded my OpenBSD 7.3 amd64 to 7.4. I used the usual procedure, 
the one in the upgrade FAQ. After the upgrade kate (KDE texteditor) no 
longer works!


If I execute "kate -v" here it is the output:

kate:/usr/X11R6/lib/libX11.so.17.1: /usr/X11R6/lib/libX11.so.18.0 : 
WARNING: symbol(_XkeyTable) size mismatch, relink your program

Cannot mix incompatible Qt library (5.9.7) with this library (5.15.10)
Abort trap (core dumped)

I tried "pkg_add -u" more times and there is no error.
The only warning was "Obsolete package: freetype-1.3.1p4 (no longer 
maintained upstream)", so I have done "pkg_delete freetype", but kate 
wasn't working before I deleted it too.


pkg_check find no problem.

What else I can do?
Thanks



In case someone else have the same problem, I solved removing all the 
old versions of programs/libs with "pkg_delete -a".


It's a bit risky, but I had no bad consequences.



Re: SSL issues after upgrading from 7.3 to 7.4

2023-10-21 Thread Mark
So, no idea on this?

There are people having similar SSL issues (have been reading about them in
IRC channels)

I don't use TLSv1.0, TLSv1.1 neither. I'm aware of the related-changes in
7.4.

Best,
Mark.

Mark , 16 Eki 2023 Pzt, 22:01 tarihinde şunu
yazdı:

> Hi.
>
> First of all, thank you very much for all your great efforts on 7.4!
>
> I upgraded my VPS from 7.3 to 7.4, and It's weird that, after upgrade,
> Qualys SSL Labs test for HTTPS/SSL websites gives:
> "HTTP request to this server failed, see below for details."
>
> However, my website works fine with browsers,
> and my nginx configuration has nothing weird at all,
> checked with "nginx -t", I had no such message as I checked just before I
> upgraded.
>
> And also, one more tool; immuniweb.com/ssl/ reports:
> "SERVER DOES NOT SUPPORT OCSP STAPLING" after the upgrade.
>
> However, again, OCSP stapling is implemented correctly in my nginx.conf
> file, working since a year.
>
> And just before upgrade, I had no such messages from none of those SSL
> checkers.
>
> and I haven't changed anything at all regarding my nginx configuration.
>
> My VPS is rented from Hetzner, and I had created a snapshot of it just
> before the upgrade process.
> So, now one-click revert to older snapshot, back to OpenBSD 7.3, both
> tests' reports are fine now.
>
> No more "HTTP request to this server failed" from Qualys SSL Labs,
> and no more "SERVER DOES NOT SUPPORT OCSP STAPLING" from Immuniweb SSL
> test.
>
> Obviously, something is not good with 7.4?
>
> My SSL certificates are from Let's Encrypt, and I have "ssl_protocols
> TLSv1.3 TLSv1.2;" in my nginx.conf, if that would help?
>
> Best Wishes,
>
> Mark.
>