Skip to content

Fix pthread_t initialization issues in testThreads.c and libxml2 - #88

Open
SoftwareRat wants to merge 2 commits into
ps3dev:masterfrom
SoftwareRat:master
Open

Fix pthread_t initialization issues in testThreads.c and libxml2#88
SoftwareRat wants to merge 2 commits into
ps3dev:masterfrom
SoftwareRat:master

Conversation

@SoftwareRat

Copy link
Copy Markdown

This pull request addresses a compatibility issue with pthread_t initialization in libxml2 for modern toolchains. The main change ensures that thread IDs are properly zero-initialized, and the patch is now applied during the build process.

Thread initialization fix

  • Updated patches/libxml2-2.7.8-pthread.patch to replace the assignment of (pthread_t) -1 with memset to zero-initialize pthread_t variables, improving compatibility with modern compilers.

Build script update

  • Modified scripts/012-libxml2-2.7.8.sh to apply the pthread patch automatically during the build, ensuring the fix is consistently used.

Added a patch for pthread_t issue in testThreads.c.
Replaced initialization of tid array with memset to ensure proper memory clearing.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh. The patch is applied with -p1, and yet there is no filename given in the patch file. How is that supposed to work?

Also, I can't find any file in libxml2-2.7.8.tar.gz that contains this exact code. There is similar code in testThreads.c, but it is lacking the #if present in this patch...

If if acually is testThreads you are trying to alter, then

  1. tid[i] will be overwritten by pthread_create immediately afterwards, so there is no need to initialize any part of it. The assignment can just be removed.
  2. That is a testcase, do we even run them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants