Developer Forums

RSS for tag

Ask questions about how to use the Apple Developer Forums. Discuss forums bugs and enhancements requests that you’ve filed via Feedback Assistant.

Posts under Developer Forums subtopic

Post

Replies

Boosts

Views

Activity

pthread_cond_timedwait problem
I'm trying to debug an issue with the Valgrind tool Helgrind. This is on masOS 11 (I've also seen it on 12, probably the same for other macOS versions). Here is the testcase. #include <pthread.h> #include <string.h> #include <assert.h> #include <errno.h> int main(void) { pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t cond = PTHREAD_COND_INITIALIZER; int res; // This time has most definitely passed already. (Epoch) struct timespec now; memset(&now, 0, sizeof(now)); res = pthread_mutex_lock(&mutex); assert(res == 0); res = pthread_cond_timedwait(&cond, &mutex, &now); assert(res == ETIMEDOUT); res = pthread_mutex_unlock(&mutex); assert(res == 0); res = pthread_mutex_destroy(&mutex); assert(res == 0); res = pthread_cond_destroy(&cond); assert(res == 0); } The error that I'm getting from Helgrind is ==56754== Thread #1 unlocked a not-locked lock at 0x1048C7A08 ==56754== at 0x10020E2F9: mutex_unlock_WRK (hg_intercepts.c:1255) ==56754== by 0x10020E278: pthread_mutex_unlock (hg_intercepts.c:1278) ==56754== by 0x7FF80F526813: _pthread_cond_wait (in /usr/lib/system/libsystem_pthread.dylib) ==56754== by 0x10020E812: pthread_cond_timedwait_WRK (hg_intercepts.c:1465) ==56754== by 0x10020E6A8: pthread_cond_timedwait (hg_intercepts.c:1512) ==56754== by 0x100003DD2: main (cond_timedwait_test.c:18) ==56754== Lock at 0x1048C7A08 was first observed ==56754== at 0x10020DE91: mutex_lock_WRK (hg_intercepts.c:1009) ==56754== by 0x10020DD68: pthread_mutex_lock (hg_intercepts.c:1031) ==56754== by 0x100003D7D: main (cond_timedwait_test.c:16) ==56754== Address 0x1048c7a08 is on thread #1's stack ==56754== in frame #5, created by main (cond_timedwait_test.c:7) If I turn on extra tracing then on FreeBSD the Helgrind pthread traces correspond to the C source. On macOS I see an extra mutex. << pthread_mxlock 0x7ff850c41 :: mxlock -> 0 >> << pthread_mxunlk 0x7ff850c41 :: mxunlk -> 0 >> ^^ I don't know what this mutex is << pthread_mxlock 0x1048c7a08 :: mxlock -> 0 >> ^^ this is the user mutex << pthread_mxlock 0x7ff850c41 :: mxlock -> 0 >> << pthread_cond_timedwait 0x1048c79d8 0x1048c7a08 0x1048c79c0<< pthread_mxunlk 0x7ff850c41 :: mxunlk -> 0 >> ^^ pthread_cond_timedwait unlocking the non-user mutex << pthread_mxlock 0x7ff850c41 :: mxlock -> 0 >> << pthread_mxunlk 0x7ff850c41 :: mxunlk -> 0 >> << pthread_mxunlk 0x1048c7a08 [error here] :: mxunlk -> 0 >> << pthread_mxlock 0x1048c7a08 :: mxlock -> 0 >> << pthread_mxlock 0x7ff850c41 :: mxlock -> 0 >> cotimedwait -> 60 >> In these traces the "-> 0" is the return code, showing that all of the calls succeeded. I need to do more debugging inside Helgrind. In the traces above I only see the user mutex being locked and then unlocked. Can anyone explain why I'm seeing an extra mutex in there? I'll have a poke around the XNU source
0
0
32
1w
Initial stack construction
I'm having problems constructing the initial stack for the guest executable for Valgrind on macOS 12 Intel. This seemed to work OK for macOS 11 but I'm getting a bad 'apple' pointer on macOS 12. The stack (constructed by Valgrind) looks like this higher address +-----------------+ <- clstack_end | | : string table : | | +-----------------+ | NULL | +-----------------+ | executable_path | (first arg to execve()) +-----------------+ | NULL | - - | envp | +-----------------+ | NULL | - - | argv | +-----------------+ | argc | +-----------------+ | mach_header * | (dynamic only) lower address +-----------------+ <- sp | undefined | : : The problem that I'm having is with the executable path (or the apple pointer). This points to NULL. The actual pointer to the "executable=xxx" string is 16 bytes lower in memory. The code for main starts with Dump of assembler code for function main: 0x0000000100003a90 <+0>: push %rbp 0x0000000100003a91 <+1>: mov %rsp,%rbp 0x0000000100003a94 <+4>: sub $0x60,%rsp 0x0000000100003a98 <+8>: movl $0x0,-0x4(%rbp) 0x0000000100003a9f <+15>: mov %edi,-0x8(%rbp) 0x0000000100003aa2 <+18>: mov %rsi,-0x10(%rbp) 0x0000000100003aa6 <+22>: mov %rdx,-0x18(%rbp) 0x0000000100003aaa <+26>: mov %rcx,-0x20(%rbp) That's the prefix, making space for locals, setting a local variable to 0 then getting the 4 arguments from main in edi, rsi, rdx and rcx as per the SYSV amd64 ABI. I think that it is dyld that puts the apple pointer into rcx. Can anyone tall me how dyld works out the address of the apple pointer?
1
0
92
6d
WeatherKit: WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 on iOS 26.2 (Simulator & Device)
Hello everyone, I’m experiencing a WeatherKit issue that occurs consistently on both the iOS 26.2 Simulator and a real device running iOS 26.2. Environment: Xcode: latest iOS: 26.2 Occurs on: Simulator AND physical device WeatherKit usage: via WeatherService API (not manual REST) Location Services: authorized (When In Use / Always) Issue: WeatherDaemon.WDSJWTAuthenticatorServiceListener.Errors Code=2 "The operation couldn’t be completed." Already verified: WeatherKit capability is enabled for the App ID com.apple.developer.weatherkit entitlement is present Bundle ID matches the App ID App is signed with the correct Team ID Behavior is identical on Simulator and physical device Error occurs before any WeatherKit response is returned Questions: Is this a known issue with WeatherKit on iOS 26.2? Are there any known limitations or requirements for WeatherService related to WeatherDaemon validation? Is there a recommended way to diagnose why WeatherDaemon rejects the request with Code=2? Code: private let weatherService = WeatherService()
0
0
54
3d
No more possible to properly size images in a forums post ?
I used to resize images (editing width and height when writing the post) in order to avoid ridiculously large images in reading published post. Since a few weeks, that does not work anymore. When I edit, I see the reduced size in Live Preview: But once posted, images are much larger as seen below: Looks like the image is now resized to fill full width. I filed a bug report: Dec 27, 2025 at 1:43 PM – FB21446929 PS: that change ignores @eskimo wise advice "Quinn’s Top Ten DevForums Tips" n°10 (https://developer.apple.com/forums/thread/706527).
0
0
43
1d
Question Regarding App Rejection Reason
Hello, I hope you are doing well. I recently submitted my app for review, and it was rejected. However, I am still unsure about the exact reason for this decision. I carefully reviewed the feedback provided, but some points remain unclear to me. Could you please clarify which specific guidelines were not met, or which parts of the app need to be changed or improved? My goal is to fully understand the issue so I can fix it properly and ensure that the app complies with all App Store Review Guidelines in the future. Thank you in advance for your time and support.
1
0
28
17h
iOS Safari Rendering Issue: Sticky Header Sometimes Fails to Update After DOM Changes
I’m encountering an issue on iOS when rendering a list using React. Each list item uses the array index as the React key and consists of two parts: a header section that uses position: sticky for dynamic sticking behavior, and a body section whose height is automatically adjusted based on its content. When the list data is updated, I sometimes observe that the sticky header content does not update visually in time, even though the underlying data and DOM have changed. // demo.jsx import React, { useState } from 'react'; import { Button } from '@iftide/mobile'; import './style2.less'; // import data1 from './data1.json'; // import data2 from './data2.json'; const prefixCls = 'im-detaillist'; const data1 = [ { sectionTitle: '2025年05月' }, { sectionTitle: '2025年04月' }, { sectionTitle: '2025年03月' } ]; const data2 = [ { sectionTitle: '2023年08月' }, { sectionTitle: '2023年07月' }, { sectionTitle: '2023年06月' }, { sectionTitle: '2023年05月' } ]; export default function App() { const [list, setList] = useState(data1); const [toggle, setToggle] = useState(true); return ( <div> <Button title="更新2" onClick={() => { setToggle(!toggle); setList(data2); }} /> <div className={`${prefixCls}-container2`} style={{ height: `700px` }}> {list.map((section: any, sectionIdx: number) => { return ( <div className={`${prefixCls}`} key={String(sectionIdx)} // id={section.sectionTitle} > <div className={`${prefixCls}-section-title`} role="text"> {section.sectionTitle} </div> <div style={{ background: 'green', height: `${Math.ceil(400 * Math.random()) + 50}px` }} > 省略 </div> </div> ); })} </div> </div> ); } .@{prefixCls}-section-title { position: sticky; position: -webkit-sticky; will-change: transform; top: 0; z-index: 1; padding-left: 11px; width: 100%; height: 30px; font-size: var(--font-size-s); font-weight: 400; line-height: 30px; color: #000000; background-color: #F4F5F7; letter-spacing: 0; }
0
0
61
9h
Apple Developer Forums post is not published
■Confirmation My post on the Apple Developer Forums is not published even though it have been reviewed. Does any work need to be done at the time of submission or after review in order to be published? ■Background of the question I posted one on the Apple Developer Forums yesterday. Immediately after posting, a message saying "It will be published if it passes the review" was displayed on the screen. This morning, that message disappeared, so I thought the post had been published, but my post was not displayed on the post list screen. I tried searching for the post title, but it doesn't appear for a while.
5
0
1.1k
May ’25
Is it possible to publish an article on this forum?
Hello, forum admins. Thank you for your work in maintaining the forum in an active working condition. I have a question for you. Is it possible here, on the forum, not only to ask questions and get answers, but also to conduct technical discussions on current programming issues? For example, I would like to publish an article on design programming patterns and hear the opinions of other programmers working in this direction. I know that there are resources where we can publish articles. But here is the most big and active community of programmers using Apple technologies and it would be great to have the opportunity to publish articles here and organize thematic discussions. Best regards, John
4
0
746
Jan ’25
App.pkg notarization is stuck since 3 days
Hi, Our organization develops a Mac app and distributes it our of the Mac store. We have been creating App.dmg files for this and signed it with the Developer ID Application certificate and uploaded them for notarization using "xcrun notarytool". Everything was working fine until we created a new Developer ID Installer certificate to test the new App.pkg installer and uploaded it for notarization to the Apple server. It's been 3 days now and our production pipeline is stuck because all the submissions remain in In-Progress state and do not proceed further. Details of the submission:- createdDate: 2025-01-03T06:44:20.306Z id: 7af70d77-1bab-4b17-aeba-7ddc75c030f9 name: XXXXXXXXXXXXXXX.pkg status: In Progress Since then, no submission(even for .dmg files) are processing through. I’ve raised a ticket with the support team as well, but it hasn’t helped. What more can we try to get out of this hole?
1
0
496
Jan ’25
Developer Forum Name Change
I have been waiting for months to get the name of my account on the developer forum changed. I had initially set it up as Playbrainiacs to match my solely owned company name. However, some other people started using "Playbrainiac" without the s at the end, in their websites etc. causing confusion. They also refused to sell the url to me for a reasonable price. I applied for a Trademark with USTPO in the name Playbrainiacs but it was denied due to a company in Canada with a name called PlayBrainy. Given my small budget I decided to abandon it and forgo the needless lawyer costs. Consequently I changed my company name to "Gigi Sehgal LLC" and removed the name Playbrainiacs everywhere. BUT Apple developer forum support has STILL not updated the name here. This is becoming a marketing and legal liability for me. Anybody have insights in how to get this fixed soon? My App was approved however I turned encryption on and am now waiting on the classification category code for the same from the US Govt ( that has also been pending for over a month )
4
0
576
Jan ’25
Request to Change Username on Developer Forum
Dear [Support Team/Moderator], I hope you are doing well. I would like to request a username change for my account on the AbhishekOpl. Unfortunately, I couldn’t find an option to update it in the profile settings. Here are my details: Current Username: AbhishekOpl Desired Username: ManishOpl If a username change is not possible, please let me know any alternative solutions. I appreciate your assistance and look forward to your response. Best regards,
3
0
305
Feb ’25
Fed up with forum "Unauthorized" messages.
I'm fed up with this. I write a detailed message and press Submit, and I get that. I press back, and my composition is gone. I think it happens most often when I've logged in only recently, i.e. I've read a few posts, decide to reply to one and log in. At that point, if I close everything and start again and find the thread I want to reply to then it works. But if I don't do that then I run the risk of being told I'm "unauthorized" and losing whatever I've written. This isn't rocket science! Why do we put up with it?
3
0
376
Mar ’25