# issue in copying the hash table(Reposted third time)

- Thread: https://externals.io/message/10816
- Original archive: https://news-web.php.net/php.internals/10816
- Started by Kamesh Jayachandran on 2004-06-28T06:16:51+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #10816 — Kamesh Jayachandran — 2004-06-28T06:16:51+00:00

URL: https://externals.io/message/10816#10816

Hi All,
Sorry to repost for the third time. 
I want the clarification regarding copying the global_class_table to
thread specific compiler_globals->class_table in compiler_globals_ctor
in Zend/zend.c.

According to me memcpy should copy 'whatever source points to' to
'destination'.
Our class_table hashtable structure looks like this,
char *key;
zend_class_entry** value;
So memcpy should copy only whatever (zend_class_entry**) points to which
is semantically wrong good candidate for Segmentation fault.

No way memcpy can do double dereferencing for this case.

Somehow in Linux when i compile it with maintainer-zts-mode memcpy
copies the data fine.
I verified all the internal classes. Thread specific class_table is in
sink with the global_class_table.


Please clarify.

Thanks in Advance


With regards
Kamesh Jayachandran

---

## #10825 — Andi Gutmans — 2004-06-28T14:58:59+00:00

URL: https://externals.io/message/10816#10825 · In reply to: #10816

I don't quite understand the question.
Can you rephrase what exactly is bothering you?

Andi

At 03:46 AM 6/28/2004 +0530, Kamesh Jayachandran wrote:
>Hi All,
>Sorry to repost for the third time.
>I want the clarification regarding copying the global_class_table to
>thread specific compiler_globals->class_table in compiler_globals_ctor
>in Zend/zend.c.
>
>According to me memcpy should copy 'whatever source points to' to
>'destination'.
>Our class_table hashtable structure looks like this,
>char *key;
>zend_class_entry** value;
>So memcpy should copy only whatever (zend_class_entry**) points to which
>is semantically wrong good candidate for Segmentation fault.
>
>No way memcpy can do double dereferencing for this case.
>
>Somehow in Linux when i compile it with maintainer-zts-mode memcpy
>copies the data fine.
>I verified all the internal classes. Thread specific class_table is in
>sink with the global_class_table.
>
>
>Please clarify.
>
>Thanks in Advance
>
>
>With regards
>Kamesh Jayachandran
