You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--TEST--
Bug#74892 Url Rewriting (trans_sid) not working on urls that start with #
--INI--
session.use_cookies=0
session.use_only_cookies=0
session.use_trans_sid=1
session.trans_sid_hosts=php.net
--EXTENSIONS--
session
--SKIPIF--
<?phpinclude('skipif.inc'); ?>
--FILE--
<?phpini_set('session.trans_sid_hosts','php.net');
session_id('sessionidhere');
session_start();
?>
<p><a href="index.php">Click This Anchor Tag!</a></p>
<p><a href="index.php#place">External link with anchor</a></p>
<p><a href="http://php.net#foo">External link with anchor 2</a></p>
<p><a href="#place">Internal link</a></p>
--EXPECT--
<p><a href="index.php?PHPSESSID=sessionidhere">Click This Anchor Tag!</a></p>
<p><a href="index.php?PHPSESSID=sessionidhere#place">External link with anchor</a></p>
<p><a href="http://php.net?PHPSESSID=sessionidhere#foo">External link with anchor 2</a></p>
<p><a href="#place">Internal link</a></p>
Resulted in this output:
TEST 1/1 [ext/session/tests/bug74892.phpt]
========DIFF========
--
<p><a href="index.php?PHPSESSID=sessionidhere#place">External link with anchor</a></p>
<p><a href="http://php.net?PHPSESSID=sessionidhere#foo">External link with anchor 2</a></p>
<p><a href="#place">Internal link</a></p>
005+ [Fri Apr 5 20:37:59 2024] Script: '/mnt/d/projects/php-src/ext/session/tests/bug74892.php'
006+ /mnt/d/projects/php-src/Zend/zend_string.h(176) : Freeing 0x00007f921c406740 (32 bytes), script=/mnt/d/projects/php-src/ext/session/tests/bug74892.php
007+ === Total 1 memory leaks detected ===
008+ zend_mm_heap corrupted
009+ Segmentation fault
010+
011+ Termsig=11
But I expected this output instead:
PASS
Happens on Ubuntu in WSL on the current master branch.
PHP Version
master
Operating System
Ubuntu 22.04.4 LTS
The text was updated successfully, but these errors were encountered:
Given that it doesn't repro under USE_ZEND_ALLOC=0, this is very likely a persistent vs non-persistent allocation mess-up.
Are you taking a look already or shall I?
….trans_sid_hosts
The hash tables used are allocated via the persistent allocator.
When using ini_set, the allocation happens via the non-persistent
allocator. When the table is then freed in GSHUTDOWN, we get a crash
because the allocators are mismatched.
As a side note, it is strange that this is designed this way, because it
means that ini_sets persist between requests...
Test credits go to Kamil Tekiela.
Description
The following test case:
Resulted in this output:
But I expected this output instead:
PASS
Happens on Ubuntu in WSL on the current master branch.
PHP Version
master
Operating System
Ubuntu 22.04.4 LTS
The text was updated successfully, but these errors were encountered: