The default bug view has changed. See this FAQ.

Support IPC Thread::SetName on Mac

RESOLVED FIXED in mozilla14

Status

()

Core
IPC
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: BenWa, Assigned: BenWa)

Tracking

(Blocks: 1 bug)

unspecified
mozilla14
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

5 years ago
Created attachment 604687 [details] [diff] [review]
patch

Useful for gdb, this code is an adaption from chromium/src/base/threading/platform_thread_posix.cc.
Attachment #604687 - Flags: review?(jones.chris.g)
(Assignee)

Comment 1

5 years ago
Created attachment 604688 [details]
Screenshot (IPC thread 5+21 fixed by this patch)
Assignee: nobody → bgirard
Status: NEW → ASSIGNED
(Assignee)

Updated

5 years ago
Component: Graphics → IPC
QA Contact: thebes → ipc

Comment 2

5 years ago
Is this related to bug 720778 at all?
(Assignee)

Updated

5 years ago
Blocks: 720778
Comment on attachment 604687 [details] [diff] [review]
patch

Did you check if this was fixed in upstream chromium?  I'd be happy to pull a change from there, too.

>+  std::string shortened_name = std::string(name).substr(0, kMaxNameLength);
>+  // pthread_setname() fails (harmlessly) in the sandbox, ignore when it does.
>+  // See http://crbug.com/47058
>+  dynamic_pthread_setname_np(shortened_name.c_str());

What's the ownership model for the pointer here?  Please doc.

r=me with ownership clarified (/ proven correct ;) ).
Attachment #604687 - Flags: review?(jones.chris.g) → review+
(Assignee)

Comment 4

5 years ago
I got the code from 'chromium/src/base/threading/platform_thread_posix.cc', wouldn't that be upstream? The change doesn't apply cleanly so I had to make a patch manually.
(Assignee)

Comment 5

5 years ago
I looked in bionic and it's implemented by copying name:
bionic/libc/bionic/pthread.c

So it must certainly be the same elsewhere. I'll add a comment when checking in.
(Assignee)

Comment 6

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/192785313581
Pulling from upstream is good.  Would prefer you check the darwin docs, but r+ from upstream (hopefully) means someone else already checked docs.
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/192785313581
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
No longer blocks: 598873
Blocks: 598873
You need to log in before you can comment on or make changes to this bug.