nm-symbolicate.py picks up wrong nm binary ("invalid argument -D")

RESOLVED FIXED in mozilla34

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: mstange, Assigned: mstange)

Tracking

Trunk
mozilla34
All
Gonk (Firefox OS)
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

4 years ago
When using "./profile.sh capture" after profiling the b2g Compositor thread, symbolication fails on my Mac and a broken profile is created.

The problem is that nm-symbolicate.py uses the wrong nm binary. On my machine it uses

Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm

when it should be using

/Volumes/firefoxos/B2G/prebuilts/gcc/darwin-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-nm

XCode's nm doesn't support the -D and -S flags that we pass to it and prints the following error message during ./profile.sh capture:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm: invalid argument -D
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/nm [-agnopruUmxjlfAP[s segname sectname] [-] [-t format] [[-arch <arch_flag>] ...] [file ...]
(Assignee)

Comment 1

4 years ago
Created attachment 8466186 [details] [diff] [review]
v1
Attachment #8466186 - Flags: review?(bgirard)
Comment on attachment 8466186 [details] [diff] [review]
v1

Review of attachment 8466186 [details] [diff] [review]:
-----------------------------------------------------------------

::: tools/profiler/nm-symbolicate.py
@@ +13,5 @@
>    ]
> +  try:
> +    nm_lines = subprocess.check_output(args).split("\n")
> +  except subprocess.CalledProcessError:
> +    sys.exit(-1)

You should log something instead of silently failing or just let the error bubble up so that it will be echo'ed
Attachment #8466186 - Flags: review?(bgirard) → review+
(Assignee)

Comment 3

4 years ago
OK, I'll just revert the error handling change.
(Assignee)

Comment 4

4 years ago
Created attachment 8466197 [details] [diff] [review]
v2
Attachment #8466186 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/ebfcfbeba792
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.