Can't connect to Chrome from the debugger

126 views
Skip to first unread message

Ed O'Loughlin

unread,
Feb 20, 2015, 2:19:46 PM2/20/15
to native-cli...@googlegroups.com
Hi,

I can't get Chrome to pause for the debugger. I've built with -g -O0, I've changed my nmf gfile so the .bc file is loaded (I can see this in the network view in dev tools). In my environment, I've got NACL_PLUGIN_DEBUG and NACLVERBOSITY set to 1. My command line to run Chrome is

    /usr/bin/google-chrome --no-sandbox --enable-nacl --enable-nacl-debug --disable-hang-monitor

I've tried specifying and not specifying my site URL on the command line. I've tried this on Windows, Mac and Linux with Chrome 40. My PNACL is built with pepper_40.

When Chrome loads my pexe I see some logging on stdout:


[0220/191617:ERROR:nacl_helper_linux.cc(289)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
[0220/191617:ERROR:nacl_sandbox_linux.cc(150)] The SUID sandbox is not engaged for NaCl: this is dangerous.
[0220/191617:ERROR:nacl_sandbox_linux.cc(159)] The seccomp-bpf sandbox is not engaged for NaCl: this is dangerous.
[7770,416471296:19:16:17.088029] NaClSetUpBootstrapChannel: descriptor 19, error 0
[7770,416471296:19:16:17.088236] NaClPerfCounterInterval(NaClAppLoadFile __start__:PreAllocAddrSpace): 21 microsecs
[7770,416471296:19:16:17.088371] Native Client module will be loaded at base address 0x0000115d00000000
[7770,416471296:19:16:17.088382] NaClPerfCounterInterval(NaClAppLoadFile PreAllocAddrSpace:*AllocAddrSpace): 146 microsecs
[7770,416471296:19:16:17.088390] NaClElfFileMapSegment: mapping for validation
[7770,416471296:19:16:17.088393] NaClPerfCounterInterval(NaClElfFileMapSegment __start__:PreMap): 4 microsecs
[7770,416471296:19:16:17.088401] NaClPerfCounterInterval(NaClElfFileMapSegment PreMap:MapForValidate): 7 microsecs
[7770,416471296:19:16:17.089539] NaClPerfCounterInterval(NaClElfFileMapSegment MapForValidate:ValidateMapped): 1138 microsecs
[7770,416471296:19:16:17.089551] NaClElfFileMapSegment: mapping into code space
[7770,416471296:19:16:17.089554] NaClElfFileMapSegment: EXERCISING MMAP LOAD PATH
[7770,416471296:19:16:17.089562] NaClPerfCounterInterval(NaClElfFileMapSegment ValidateMapped:MapFinal): 23 microsecs
[7770,416471296:19:16:17.089569] NaClPerfCounterInterval(NaClElfFileMapSegment __start__:MapFinal): 2 microsecs
[7770,416471296:19:16:17.089590] NaClPerfCounterInterval(NaClElfFileMapSegment __start__:PRead tail): 17 microsecs
[7770,416471296:19:16:17.089599] NaClPerfCounterInterval(NaClElfFileMapSegment PRead tail:MapFinal): 9 microsecs
[7770,416471296:19:16:17.089603] NaClPerfCounterInterval(NaClAppLoadFile *AllocAddrSpace:*NaClElfImageLoad): 1220 microsecs
[7770,416471296:19:16:17.089731] NaClPerfCounterInterval(NaClAppLoadFile *NaClElfImageLoad:*MakeDynText): 128 microsecs
[7770,416471296:19:16:17.089737] NaClPerfCounterInterval(NaClAppLoadFile *MakeDynText:*ValidateImg): 7 microsecs
[7770,416471296:19:16:17.089819] NaClPerfCounterInterval(NaClAppLoadFile __start__:EndLoadFile): 1604 microsecs
[7770,416471296:19:16:17.090291] Skipped NaClLoadIrt, irt_load_optional with dynamic_text_end: c20000
[7611,3652085504:19:16:17.095933] PluginReverseInterface::StartupInitializationComplete: init_done_cb_ not valid, skipping.


If I try to connect from gdb it just times out. 20 seconds after the first set of logs I see this, which is my pexe crashing:

** Signal 11 from untrusted code: pc=115d006e1430
[0220/191723:ERROR:nacl_helper_linux.cc(289)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
[SRPC:HOST:7611,3634300672:19:17:23.406298] NaClSrpcRpcWait(channel=0x2cf5bd7d7cf0): EOF is received instead of response. Probably, the other side (usually, nacl module or browser plugin) crashed.
[7508:7537:0220/191723:ERROR:nacl_process_host.cc(289)] NaCl process exited with status 62720 (0xf500)



I'd really appreciate some help on this. My pexe never makes it as far as bring able to receive a message.

Thanks,
Ed.

Jan Voung

unread,
Feb 20, 2015, 2:36:27 PM2/20/15
to native-cli...@googlegroups.com
If you have not already cached a translation of the .bc file, your logs should actually show 3 applications load, one after the other (pnacl-llc.nexe, pnacl-ld.nexe, your_app), and on the final app load it should show:

nacl_process_host.cc... debug stub on port 4014
Native Client module will be loaded at base address 0x0000465f00000000
nacl_debug(139) : Debugging started.

Then you can connect w/ gdb via port 4014.

Is that all of your logs? What I see in your log is only one nexe loading instead of three, specifically, one that says "Skipped NaClLoadIrt, irt_load_optional with dynamic_text_end: c20000"

That is the "pnacl-llc.nexe", which should load without getting interrupted by a debugger etc. When your app loads it should not show the  "Skipped NaClLoadIrt, irt_load_optional" message.

Do you have any other special flags set, e.g., stored from changes to the chrome:flags page? The chrome:version page should list the flags. Make sure you never changed:

Restrict Native Client GDB-based debugging by pattern Mac, Windows, Linux, Chrome OS
Restricts Native Client application GDB-based debugging by URL of manifest file. Native Client GDB-based debugging must be enabled for this option to work. #nacl-debug-mask

From its default.

Otherwise, can you try a fresh profile to get fresh flag settings? One way to specify a fresh profile is use the "--user-data-dir" flag with chrome. E.g., "/usr/bin/google-chrome --user-data-dir=/tmp/temp_profile ... the rest of your flags like --no-sandbox ...".


 

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

Ed O'Loughlin

unread,
Feb 20, 2015, 2:51:36 PM2/20/15
to native-cli...@googlegroups.com


On Friday, 20 February 2015 19:36:27 UTC, Jan Voung wrote:


If you have not already cached a translation of the .bc file, your logs should actually show 3 applications load, one after the other (pnacl-llc.nexe, pnacl-ld.nexe, your_app), and on the final app load it should show:


My build produces a pexe - should this make a difference? I only see the .pexe and the .bc files loaded. What I posted is exactly what I see when I load the pexe on my page.

I'm starting with a new profile and a new install of Chrome.

Ed.

Ed O'Loughlin

unread,
Feb 20, 2015, 3:02:16 PM2/20/15
to native-cli...@googlegroups.com
I just tried loading the getting_started/part1 example from the sdk and it works. I'll see if I can find any differences between it and my config.

Thanks for your help, if nothing else you prompted me to try a different approach.

Ed.
...

Ed O'Loughlin

unread,
Feb 20, 2015, 3:05:43 PM2/20/15
to native-cli...@googlegroups.com
One main difference is that I'm using React, which dynamically adds an embed element to the page. Is this supported?


Jan Voung

unread,
Feb 20, 2015, 3:05:53 PM2/20/15
to native-cli...@googlegroups.com
What does you nmf file look like? How big is your app? Maybe pnacl-llc is failing to translate the debug version of your app, so it hasn't hit the point where you can attach to a debugger yet.

I ask about the size of your app because unfortunately, debug info can bloat the app quite a bit, and therefore increase memory requirements for pnacl-llc (and -O0 can mean more instructions to translate than a -O2 version, also increasing memory requirements).

Depending on whether this is a 32-bit or 64-bit chrome, pnacl-llc only has the 1GB or 4GB sandbox to do its work. If you need to reduce the memory usage, you can compile with -gline-tables-only, and that will at least give you line information for stack traces, etc.

Btw, you shouldn't need to get a new install of chrome =)


--

Jan Voung

unread,
Feb 20, 2015, 3:07:30 PM2/20/15
to native-cli...@googlegroups.com
Yes, it should be okay to dynamically add an embed element.

On Fri, Feb 20, 2015 at 12:05 PM, Ed O'Loughlin <ed.olo...@gmail.com> wrote:
One main difference is that I'm using React, which dynamically adds an embed element to the page. Is this supported?


Ed O'Loughlin

unread,
Feb 20, 2015, 3:21:40 PM2/20/15
to native-cli...@googlegroups.com
Funny you should ask. My app is just a wrapper around the naclports version of ffmpeg. The pexe is 11M but the .bc is 103M. If I delete the pnacl-debug section from the nmf file it still crashes. This is on Ubuntu Chrome, which might be 32-bit, I guess. I'll go try a 64-bit version.



On Friday, 20 February 2015 20:05:53 UTC, Jan Voung wrote:
What does you nmf file look like? How big is your app? Maybe pnacl-llc is failing to translate the debug version of your app, so it hasn't hit the point where you can attach to a debugger yet.

I ask about the size of your app because unfortunately, debug info can bloat the app quite a bit, and therefore increase memory requirements for pnacl-llc (and -O0 can mean more instructions to translate than a -O2 version, also increasing memory requirements).

Depending on whether this is a 32-bit or 64-bit chrome, pnacl-llc only has the 1GB or 4GB sandbox to do its work. If you need to reduce the memory usage, you can compile with -gline-tables-only, and that will at least give you line information for stack traces, etc.

Btw, you shouldn't need to get a new install of chrome =)

On Fri, Feb 20, 2015 at 11:51 AM, Ed O'Loughlin <ed.olo...@gmail.com> wrote:


On Friday, 20 February 2015 19:36:27 UTC, Jan Voung wrote:


If you have not already cached a translation of the .bc file, your logs should actually show 3 applications load, one after the other (pnacl-llc.nexe, pnacl-ld.nexe, your_app), and on the final app load it should show:


My build produces a pexe - should this make a difference? I only see the .pexe and the .bc files loaded. What I posted is exactly what I see when I load the pexe on my page.

I'm starting with a new profile and a new install of Chrome.

Ed.

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.

Ed O'Loughlin

unread,
Feb 20, 2015, 5:04:41 PM2/20/15
to native-cli...@googlegroups.com
I've got it to load without the .bc file and it waits for the debugger. There was a -O2 hidden in the wrong place in my makefile. If I now include the .bc file, it doesn't work though: "NaCl process exited with status 62720 (0xf500)". Are there any Chrome devs reading who can through some light on this status code? I'm guessing it's out of memory...


On Friday, 20 February 2015 19:19:46 UTC, Ed O'Loughlin wrote:
...
Reply all
Reply to author
Forward
0 new messages