Closed Bug 865973 Opened 12 years ago Closed 7 years ago

[unagi][tara]fix_b2g_stack.py can't work properly on linux

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
major

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: james.zhang, Unassigned)

Details

Attachments

(1 file)

I don't know if the system c++filt works properly on Linux, though I imagine it does. -- It can't work properly on Linux(Ubuntu 12.04, 11.04, etc).
This issue blocking memory leak analysis.
Add Justin, Ubuntu 12.04 python2.7 fix_b2g_stack.py can't work properly.
Hi, James. I use Linux every day, and this program works fine for me. What that comment says is that the /system/ c++filt -- the one that comes with the computer -- doesn't work on mac (and may or may not work on Linux). So instead, I use the one that comes with the Android toolchain. If fix_linux_stack.py doesn't work for you, can you please give me more information about what's going wrong? Thanks.
Hi Justin, I use Ubuntu12.04/11.04, when use ./get_about_memory.py, wait for a long long time, nothing output. But apply this patch, it works fine. I have tried 5 computers and get the same result. My python version is 2.7. Need I install any plug-in for it?
You shouldn't need to install any plug-ins to make it work. All you should need is a full checkout of the B2G repository and all of its sub-repositories, which you get by > $ git checkout git://github.com/mozilla-b2g/B2G.git > $ ./repo sync Do you have that? What is the output of the following commands, run from the root B2G directory? It should match my output > $ ls -l prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt -rwxrwxr-x 1 jlebar jlebar 512336 May 22 2012 prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt > $ sha1sum prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt 2567e75371af2b808a519af98737aee3ee956679 prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt How are you invoking fix_b2g_stack, exactly?
Also, what happens if you replace > [options.cross_bin('c++filt')], with > 'c++filt' ? This should cause you to use the system c++filt.
(In reply to Justin Lebar [:jlebar] from comment #5) > You shouldn't need to install any plug-ins to make it work. All you should > need is a full checkout of the B2G repository and all of its > sub-repositories, which you get by > > > $ git checkout git://github.com/mozilla-b2g/B2G.git > > $ ./repo sync > > Do you have that? > Yes > What is the output of the following commands, run from the root B2G > directory? It should match my output > > > $ ls -l prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt > -rwxrwxr-x 1 jlebar jlebar 512336 May 22 2012 > prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux- > androideabi-c++filt -rwxr-xr-x 1 apuser apuser 512336 2013-03-13 13:00 prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt > > $ sha1sum prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt > 2567e75371af2b808a519af98737aee3ee956679 > prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux- > androideabi-c++filt > 2567e75371af2b808a519af98737aee3ee956679 prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt > How are you invoking fix_b2g_stack, exactly? cd B2G/tools ./get_about_memory.py
(In reply to Justin Lebar [:jlebar] from comment #6) > Also, what happens if you replace > > > [options.cross_bin('c++filt')], > > with > > > 'c++filt' > > ? This should cause you to use the system c++filt. Yes, it works fine now.
This is very weird. >> How are you invoking fix_b2g_stack, exactly? > cd B2G/tools > ./get_about_memory.py On a DMD build, I guess? Maybe the Android toolchain c++filt binary doesn't work for you for some reason. How about running > $ echo _ZN9wikipedia7article6formatEv | prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt This should output > wikipedia::article::format() I could just replace the Android toolchain c++filt with the native c++filt on Linux, but I'm concerned about this because this tool has worked for lots of other people on *nix, and if something is wrong with your c++filt, maybe something is also wrong with the other Android toolchain binaries. If the shell script above works as expected, can you apply the following patch and tell me what the output looks like? > class Pumper(threading.Thread): > def run(self): > while True: > bytes = src.read(4096) >+ print('Read %d bytes' % len(bytes)) > if not bytes: >+ print('break') > break > dst.write(bytes) > dst.close() Also, can you check that options.cross_bin(c++filt) is the prebuilt/linux-x86/.../c++filt binary, as above?
(In reply to Justin Lebar [:jlebar] from comment #9) > This is very weird. > > >> How are you invoking fix_b2g_stack, exactly? > > cd B2G/tools > > ./get_about_memory.py > > On a DMD build, I guess? > Yes, for DMD. > Maybe the Android toolchain c++filt binary doesn't work for you for some > reason. How about running > > > $ echo _ZN9wikipedia7article6formatEv | prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt > > This should output > > > wikipedia::article::format() > My result is the same as you. echo _ZN9wikipedia7article6formatEv | prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-c++filt wikipedia::article::format() > I could just replace the Android toolchain c++filt with the native c++filt > on Linux, but I'm concerned about this because this tool has worked for lots > of other people on *nix, and if something is wrong with your c++filt, maybe > something is also wrong with the other Android toolchain binaries. > > If the shell script above works as expected, can you apply the following > patch and tell me what the output looks like? > > > class Pumper(threading.Thread): > > def run(self): > > while True: > > bytes = src.read(4096) > >+ print('Read %d bytes' % len(bytes)) > > if not bytes: > >+ print('break') > > break > > dst.write(bytes) > > dst.close() > > Also, can you check that options.cross_bin(c++filt) is the > prebuilt/linux-x86/.../c++filt binary, as above?
Hi Justin, Get_about_memory can't work fine on Ubuntu11.04/python 2.7, and it works fine on Ubuntu12.04/python 2.7.3. I have applied your patch on Ubuntu11.04, output 'Read' log but no 'break' log. But our device tara( spreadtrum's sp8810ea ) use Ubuntu11.04, can you help to support Ubuntu11.04.
Ubuntu11.04 need my patch, and Ubuntu12.04 need not my patch.
Okay, now we're getting somewhere... I'll see if I can reproduce this locally with an old version of Python.
Flags: needinfo?(justin.lebar+bug)
I'm having difficulty getting Python 2.7 to build on my machine. It sounds like there's a bug in Python 2.7 that's fixed in Python 2.7.3. That's not the kind of thing that we can support in general; I'm sure that you understand that we don't have the resources to work around bugs in old versions of all of the tools that we use. Ubuntu 11.04 is no longer supported by Canonical, so I can't recommend using it for building B2G. From comment 11, it sounds like you have a virtual machine for the tara devices. If you're stuck at 11.04, can you just build and install Python 2.7.3 on there? Alternatively, I'd be happy to take a patch that adds --system-c++filt option to fix_b2g_stack.py's add_argparse_arguments function. That will let you work around this problem, but I cannot guarantee that you will not have other problems with this tool or others; we use Python quite heavily in our build.
Flags: needinfo?(justin.lebar+bug)
> It sounds like there's a bug in Python 2.7 that's fixed in Python 2.7.3. Or alternatively, perhaps some library on Ubuntu 11.04 doesn't work right with the Android c++filt. It's really hard to say.
Ok, I'll update ubuntu or python version. Before upgrade complete, we apply this patch for DMD. Thank you.
Firefox OS is not being worked on
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: