bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Update gdbserver

RESOLVED FIXED in Firefox OS v2.1

Status

Firefox OS
GonkIntegration
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: gwagner, Assigned: cyu)

Tracking

unspecified
2.1 S9 (21Nov)
x86
Mac OS X
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:2.1+, b2g-v2.1 fixed, b2g-v2.2 fixed)

Details

Attachments

(4 attachments, 3 obsolete attachments)

(Reporter)

Description

4 years ago
Using ./run-gdb.sh currently fails with debug builds. We need to update gdbserver.
(Reporter)

Comment 1

4 years ago
[Blocking Requested - why for this release]: We need gdb for 2.1
blocking-b2g: --- → 2.1?
(Assignee)

Comment 2

4 years ago
Created attachment 8500817 [details] [diff] [review]
run-gdb-workaround.patch

Before we upgrade gdbserver, this patch to run-gdb.sh can work the problem around.
(Reporter)

Comment 3

4 years ago
Thanks Cervantes.
Michael, can you take care of updating gdbserver?
Flags: needinfo?(mwu)

Comment 4

4 years ago
I recommend finding someone else.
Flags: needinfo?(mwu)
(Reporter)

Comment 5

4 years ago
Someone has to own this bug and update gdbserver. Jed, Dave, Cervantes, any takers?
Flags: needinfo?(jld)
Flags: needinfo?(dhylands)
Flags: needinfo?(cyu)
(Assignee)

Comment 6

4 years ago
I am interested in this.
Assignee: nobody → cyu
Flags: needinfo?(jld)
Flags: needinfo?(dhylands)
Flags: needinfo?(cyu)
(Assignee)

Comment 7

4 years ago
So we need the fix included in gdbserver 7.7. gdbserver 7.7 and gdb 7.1 (that we currently use) doesn't work together. What's the best upgrade path to take?

1. Upgrade both gdb and gdbserver to 7.7, but NDK only has 7.6. We need to put the custom-built gdb/gdbserver to prebuilts.
2. Upgrade gdb to 7.6 from NDK, but build gdbserver ourselves. Currently I haven't seen major problems with this combination.
3. Backport the fix to 7.6 or 7.1. Backport to 7.6 should not be a problem, but I am not sure if it's possible to backport to 7.1.

Dave, what do you say?
Flags: needinfo?(dhylands)
Step 2 sounds like the simplest. Changing which hash we use from prebuilts is possible, but I don't think we can actually change anything in prebuilts (we get it from uptream).

Step 3 also seems feasible (if we can backport in a way that only affects gdbserver). gdbserver is actually quite simple (compared to gdb).

So I think we'll need to add steps to get our updated gdbserver into /system without grabbing it from prebuilts. But I think that just winds up being some Makefile magic.

Getting a gdb/gdbserver that works is the fist step. I can help out with getting it installed.
Flags: needinfo?(dhylands)
(In reply to Dave Hylands [:dhylands] from comment #8)
> So I think we'll need to add steps to get our updated gdbserver into /system
> without grabbing it from prebuilts. But I think that just winds up being
> some Makefile magic.

In bug 985775, I tried and failed to find the makefile magic in question.  I eventually settled for installing a "gdbserver.new" and making run-gdb.sh detect it; that never landed because we worked around the problem instead.

Speaking of bug 985775, it would be good if we could get rid of the 7.1 gdbservers that don't support POSIX signal features that we're actively using.  It was also be good if we could get rid of the 6.x gdbservers that don't even work (e.g., emulator-x86-kk) and the completely nonexistent gdbservers (e.g., emulator-x86, at least the last time I tried to use it).
(Assignee)

Comment 10

4 years ago
Created attachment 8505393 [details] [diff] [review]
0001-Bug-1078373-update-gdbserver-to-7.7.patch

The patch to update prebuilts/misc/android-arm/gdbserver binary to 7.7.

This is built from gdb-7.7 source from GNU using NDK r10b.
(Assignee)

Comment 11

4 years ago
For flame-kk the update path is easier: gdb is already upgraded to 7.6, so we only need to upgrade gdbserver to 7.7. It looks like we need to fork prebuilts/misc from upstream before it has upgraded to 7.7.
(Assignee)

Comment 12

4 years ago
Dave, what's your suggestion with prebuilts/misc and other configs than flame-kk?
Flags: needinfo?(dhylands)
I think it depends on what's needed. I guess we need to figure out where else would the gdbserver binary from the flame-kk prebuilt tree work?

For the ones that don't work, we probably need to evaluate the effort required to backport (and maybe it isn't worth backporting anything - I guess it really depends on what platforms are actively being used and having issues.
Flags: needinfo?(dhylands)
Developer blocking = 2.1+ (despite it not being a user-visible thing and me not being entirely clear why we can't just uplift).
blocking-b2g: 2.1? → 2.1+
(Assignee)

Comment 15

4 years ago
Dave

Would you please clone https://github.com/CervantesYu/platform_prebuilts_misc_2 to mozilla-b2g? This contains 'gdbserver-7-7' branch for flame-kk. Then I will update the manifest for flame-kk.

For other JB-based devices we might need to use arm-linux-android-eabi-4.8, but only for its gdb-7.6 if we don't want to also upgrade the toolchain.
Flags: needinfo?(dhylands)
I don't have permission to do that. Perhaps mwu does?
Flags: needinfo?(dhylands) → needinfo?(mwu)

Comment 17

4 years ago
Fork created at https://github.com/mozilla-b2g/platform_prebuilts_misc . Use b2g-4.4.2_r1 as the branch for kk aosp based devices. For kk caf based devices, I recommend attempting to upstream it first (ask :m1 for review) since it is a generally useful fix/upgrade for all users. If it's not accepted upstream, we can point our manifest at our fork.

Why is your gdbserver binary twice the size of the old binary? Do you need to strip it?
Flags: needinfo?(mwu)
(Assignee)

Comment 18

4 years ago
It's not stripped. I will strip it and send out the update.
(Assignee)

Updated

4 years ago
See Also: → bug 1087161
(Assignee)

Comment 19

4 years ago
Created attachment 8509428 [details] [review]
GitHub Pull Request
Attachment #8505393 - Attachment is obsolete: true
Attachment #8509428 - Flags: review?(mwu)

Comment 20

4 years ago
Comment on attachment 8509428 [details] [review]
GitHub Pull Request

The PR is on the wrong branch.
Attachment #8509428 - Flags: review?(mwu)
(Assignee)

Comment 21

4 years ago
Michael, would you please open the target branch on mozilla-b2g/platform_prebuilts_misc? Thanks.
Flags: needinfo?(mwu)

Comment 22

4 years ago
I created the branch when I created the mirror. It's b2g-4.4.2_r1, as mentioned in comment 17.
Flags: needinfo?(mwu)
(Assignee)

Comment 23

4 years ago
Created attachment 8510770 [details] [review]
GitHub Pull Request

Pull request to mozilla-b2g/platform_prebuilts_misc/b2g-4.4.2_r1.
Attachment #8509428 - Attachment is obsolete: true

Comment 24

4 years ago
Did you want me to review that?

BTW, you'll also need to open a bug to mirror the new repo so emulator/nexus kk builds can pick it up. https://wiki.mozilla.org/ReleaseEngineering/RepositoryCreationRequest#Requester.27s_Actions:
(Assignee)

Updated

4 years ago
Attachment #8510770 - Flags: review?(mwu)
(Assignee)

Comment 25

4 years ago
(In reply to Michael Wu [:mwu] from comment #24)
> Did you want me to review that?
> 
Sorry for forgetting to set the review flag.

> BTW, you'll also need to open a bug to mirror the new repo so emulator/nexus
> kk builds can pick it up.
> https://wiki.mozilla.org/ReleaseEngineering/
> RepositoryCreationRequest#Requester.27s_Actions:

So we are using git.mozilla.org instead of the this one hosted on github.com/mozilla-b2g for the .repo manifests? I am getting confused.

Comment 26

4 years ago
(In reply to Cervantes Yu from comment #25)
> > BTW, you'll also need to open a bug to mirror the new repo so emulator/nexus
> > kk builds can pick it up.
> > https://wiki.mozilla.org/ReleaseEngineering/
> > RepositoryCreationRequest#Requester.27s_Actions:
> 
> So we are using git.mozilla.org instead of the this one hosted on
> github.com/mozilla-b2g for the .repo manifests? I am getting confused.

The manifests are automatically rewritten to pull from git.mozilla.org on the build machines.

Comment 27

4 years ago
The gdbserver binary works for me - thanks.

Can you update your commit message so it includes all the necessary details of how to reproduce the binary? Include the exact NDK used, additional packages (if any), and the commands you used to build.
(Assignee)

Updated

4 years ago
Depends on: 1090855
(Assignee)

Comment 28

4 years ago
I'll collect the build steps and update the commit messages.
(Assignee)

Comment 29

4 years ago
How I build gdbserver (the hacky way)

With ndk-r10b under /opt/build/android-ndk-r10b/
and gdb-7.7 source under /opt/build/gdb-7.7/:

> cd /opt/build/gdb-7.7/gdb/gdbserver
> export CC="/opt/build/android-ndk-r10b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/arm-linux-androideabi/bin/gcc --sysroot=/opt/build/android-ndk-r10b/platforms/android-19/arch-arm"
> ./configure --host=arm-linux-androideabi
> make
This fails on my machine for Elf64_auxv_t and Elf32_auxv_t not found:
linux-low.c:5227:15: error: 'Elf64_auxv_t' undeclared (first use in this function)
     ? sizeof (Elf64_auxv_t) : sizeof (Elf32_auxv_t);
               ^
I have to manually comment out
#define HAVE_ELF32_AUXV_T 1
#define HAVE_ELF64_AUXV_T 1
in config.h to make it build.
> /opt/build/android-ndk-r10b/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/arm-linux-androideabi/bin/strip gdbserver

The struct definition is in elf.h, there seems to be inconsistency between configure and build time. I need to find out how to build without this hacky modification.

Comment 30

4 years ago
Wasn't there scripts in the ndk to rebuild parts of the ndk?
(Assignee)

Comment 31

4 years ago
You mean make-standalone-toolchain.sh in NDK? Yes, but we don't really have to go through that step. According to https://developer.android.com/tools/sdk/ndk/index.html we just need to invoke gcc with correct --sysroot argument.

android-19 sysroot has the above error. I used the combination of ndk8/android14 and gdbserver builds without the above error.

Comment 32

4 years ago
Ok. Can you update the commit message?
(Assignee)

Updated

4 years ago
Depends on: 1093597
(Assignee)

Comment 33

4 years ago
(In reply to Michael Wu [:mwu] from comment #32)
> Ok. Can you update the commit message?

The commit message is updated.

Updated

4 years ago
Attachment #8510770 - Flags: review?(mwu) → review+

Comment 34

4 years ago
We'll need manifest updates too to switch to this new repo and branch.
Can we get this landed soon?

Comment 36

4 years ago
Not without manifest updates and bug 1093597.
(Assignee)

Comment 37

4 years ago
Created attachment 8522888 [details]
Pull request to merge manifest on master
Attachment #8522888 - Flags: review?(mwu)
(Assignee)

Comment 38

4 years ago
Created attachment 8522890 [details] [review]
Pull request to merge manifest on v2.1
Attachment #8522890 - Flags: review?(mwu)

Comment 39

4 years ago
Comment on attachment 8522890 [details] [review]
Pull request to merge manifest on v2.1

There's a typo in this patch. Please test your manifest changes before submitting them.
Attachment #8522890 - Flags: review?(mwu) → review-

Comment 40

4 years ago
Comment on attachment 8522888 [details]
Pull request to merge manifest on master

>https://github.com/mozilla-b2g/b2g-manifest/pull/243/files

FWIW, bugzilla didn't think this was a pull request attachment. The extra /files at the end probably confused it.

Updated

4 years ago
Attachment #8522888 - Flags: review?(mwu) → review+
(Assignee)

Comment 41

4 years ago
Comment on attachment 8522890 [details] [review]
Pull request to merge manifest on v2.1

The typo is fixed.
Attachment #8522890 - Flags: review- → review?(mwu)

Updated

4 years ago
Attachment #8522890 - Flags: review?(mwu) → review+
(Assignee)

Comment 42

4 years ago
Created attachment 8523639 [details]
CPU usage when the bug is reproduced
(Assignee)

Comment 43

4 years ago
Comment on attachment 8523639 [details]
CPU usage when the bug is reproduced

Sorry Wrong bug
Attachment #8523639 - Attachment is obsolete: true

Comment 44

4 years ago
Can we land this patch? Or we are still waiting for other fixes.
Flags: needinfo?(cyu)
(Assignee)

Updated

4 years ago
Flags: needinfo?(cyu)
Keywords: checkin-needed
master: https://github.com/mozilla-b2g/b2g-manifest/commit/c7ab57c51f634cece213031e179d207876e0239a
status-b2g-v2.2: --- → fixed
Keywords: checkin-needed
Target Milestone: --- → 2.1 S9 (21Nov)
NI :cyu to help seek approval on this given on master.
Flags: needinfo?(cyu)
(Assignee)

Comment 48

4 years ago
NI bhavana for approval since we don't have approval flags for gonk pull requests.

[Approval Request Comment]
Bug caused by (feature/regressing bug #): https://sourceware.org/bugzilla/show_bug.cgi?id=15604 (it's a bug in gdbserver)
User impact if declined: No. It only affects developers debugging b2g using gdb.
Testing completed: Manually.
Risk to taking this patch (and alternatives if risky): No. It's invisible to end users.
Flags: needinfo?(cyu) → needinfo?(bbajaj)
(In reply to Cervantes Yu from comment #48)
> NI bhavana for approval since we don't have approval flags for gonk pull
> requests.
> 
> [Approval Request Comment]
> Bug caused by (feature/regressing bug #):
> https://sourceware.org/bugzilla/show_bug.cgi?id=15604 (it's a bug in
> gdbserver)
> User impact if declined: No. It only affects developers debugging b2g using
> gdb.
> Testing completed: Manually.
> Risk to taking this patch (and alternatives if risky): No. It's invisible to
> end users.
Thanks, please go ahead and land this with a=bajaj if you can, else NI :Tomcat for help checking-in.
Flags: needinfo?(bbajaj)

Updated

4 years ago
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
status-b2g-v2.1: --- → fixed
(Assignee)

Updated

4 years ago
Duplicate of this bug: 1115639
You need to log in before you can comment on or make changes to this bug.