Project

General

Profile

Actions

Bug #14579

closed

PHP error in ``handle_wireless_post()`` when toggling some wireless interface options

Added by Jonathan Lee about 1 year ago. Updated 9 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Wireless
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.09
Release Notes:
Default
Affected Version:
Affected Architecture:
SG-2100

Description

Hello fellow redmine community members. I found a php error when I change SSID to hidden. WiFi card works otherwise.

[14-Jul-2023 17:16:50 US/Pacific] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1800
Stack trace:
#0 /usr/local/www/interfaces.php(1676): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1800
[14-Jul-2023 17:17:38 US/Pacific] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1800
Stack trace:
#0 /usr/local/www/interfaces.php(1676): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1800
[14-Jul-2023 17:18:06 US/Pacific] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1800
Stack trace:
#0 /usr/local/www/interfaces.php(1676): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1800


Files

PHP_errors (4).log (891 Bytes) PHP_errors (4).log logs Jonathan Lee, 07/15/2023 12:36 AM

Related issues

Related to Todo #14790: Eliminate direct config access in ``interfaces.php``ResolvedJim Pingle

Actions
Actions #1

Updated by Kris Phillips about 1 year ago

Tested this on 23.09 DEVELOPMENT builds. I'm not able to reproduce this, so either something else is needed to recreate this or it was fixed along the way.

Actions #2

Updated by Jim Pingle about 1 year ago

  • Project changed from pfSense Plus to pfSense
  • Category changed from Wireless to Wireless
  • Target version set to 2.8.0
  • Affected Plus Version deleted (23.05.1)
  • Plus Target Version set to 23.09

The same could happen on CE, not just Plus. There are several places there for that and other settings nearby which could lead to PHP errors. On CE the lines in this error message are around ~1747, not ~1800. It's blindly setting a value several layers deep in a variable without checking if the components are an array first.

That whole section is a bit of a mess and could do with being updated to use safe array access get/set functions.

Actions #3

Updated by Jim Pingle 11 months ago

  • Assignee set to Jim Pingle
Actions #4

Updated by Michael Pfsense 10 months ago

I also have this problem when trying to take a wificard interface from SSID broadcast to no SSID broadcast on 2.7.0-RELEASE (amd64)

Actions #5

Updated by Michael Pfsense 10 months ago

Crash report begins. Anonymous machine information:

amd64
14.0-CURRENT
FreeBSD 14.0-CURRENT #1 RELENG_2_7_0-n255866-686c8d3c1f0: Wed Jun 28 04:21:19 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/obj/amd64/LwYAddCr/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/sources/FreeBSD-src-REL

Crash report details:

PHP Errors:
[09-Sep-2023 16:25:16 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:29 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:43 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:54 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748

No FreeBSD crash data found.

Actions #6

Updated by Kris Phillips 10 months ago

Michael Pfsense wrote in #note-5:

Crash report begins. Anonymous machine information:

amd64
14.0-CURRENT
FreeBSD 14.0-CURRENT #1 RELENG_2_7_0-n255866-686c8d3c1f0: Wed Jun 28 04:21:19 UTC 2023 root@freebsd:/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/obj/amd64/LwYAddCr/var/jenkins/workspace/pfSense-CE-snapshots-2_7_0-main/sources/FreeBSD-src-REL

Crash report details:

PHP Errors:
[09-Sep-2023 16:25:16 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:29 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:43 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748
[09-Sep-2023 16:25:54 America/New_York] PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1748
Stack trace:
#0 /usr/local/www/interfaces.php(1632): handle_wireless_post()
#1 {main}
thrown in /usr/local/www/interfaces.php on line 1748

No FreeBSD crash data found.

Hello Michael,

What are the exact reproduction steps you are taking to recreate this? I'm still unable to reproduce this issue on my test hardware.

Actions #7

Updated by Jim Pingle 10 months ago

  • Related to Todo #14790: Eliminate direct config access in ``interfaces.php`` added
Actions #8

Updated by Jim Pingle 10 months ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100
Actions #9

Updated by Jim Pingle 10 months ago

  • Subject changed from handle_wireless_post() php error to PHP error in ``handle_wireless_post()`` when toggling some wireless interface options

Updating subject for release notes.

Actions #10

Updated by Lev Prokofev 10 months ago

I was able to replicate the issue on

23.09-DEVELOPMENT (amd64)
built on Thu Sep 07 06:05:43 UTC 2023
FreeBSD 14.0-ALPHA2

the changeset (1857f9fbf03ad0ea7435c87a3289c5d6da50dc54) was applied, going to test it on the latest build

PHP ERROR: Type: 1, File: /usr/local/www/interfaces.php, Line: 1796, Message: Uncaught TypeError: Cannot access offset of type string on string in /usr/local/www/interfaces.php:1796
Stack trace:
#0 /usr/local/www/interfaces.php(1672): handle_wireless_post()
#1 {main}
thrown @ 2023-09-23 10:43:51
Actions #11

Updated by Lev Prokofev 10 months ago

Can't reproduce on the

23.09-DEVELOPMENT (amd64)
built on 20230922-1539
FreeBSD 14.0-CURRENT

I suppose it can be marked as resolved.

Actions #12

Updated by Jim Pingle 10 months ago

  • Status changed from Feedback to Resolved
Actions #13

Updated by Jonathan Lee 10 months ago

Thank you !!

Actions #14

Updated by Jim Pingle 9 months ago

  • Target version changed from 2.8.0 to 2.7.1
Actions

Also available in: Atom PDF