Trouble in debugging ports.

239 views
Skip to first unread message

Deepankar Tyagi

unread,
Mar 13, 2016, 4:15:40 AM3/13/16
to Native-Client-Discuss
Hi everyone,

A few months back libevent and Tor were ported to NaCl platform, at the time tor's version was 0.2.6, I wanted to update the port to tor's latest version ie 0.2.7

However I am stuck, the issue is of validation failure, tried to run sel_ldr in debug mode, still no success, tried with ncval, no output.

The only solution seem to be go through diff between branches of tor and look at modified files one by one.

I would be glad if anyone can suggest better method to pin-point the problem.

----
sel_ldr behavior seems weird in case of libevent port, tried sample/hello-world.nexe and it says socketpair not implemented, however ifdef was added in the code to fallback on different implementation of socketpair, the same binary works if loaded as chroma app verifying the correctness of code. Any suggestions.
----
As a side note, devenv port is not building, the webstore version is also not working.
--- 
pepper_49 , sdk and ports both with chrome stable ver 48.

Ben Smith

unread,
Mar 24, 2016, 2:36:18 PM3/24/16
to native-cli...@googlegroups.com
On Sun, Mar 13, 2016 at 12:15 AM, Deepankar Tyagi <nonfa...@gmail.com> wrote:
Hi everyone,

A few months back libevent and Tor were ported to NaCl platform, at the time tor's version was 0.2.6, I wanted to update the port to tor's latest version ie 0.2.7

However I am stuck, the issue is of validation failure, tried to run sel_ldr in debug mode, still no success, tried with ncval, no output.

This is surprising, I'd assume you'd get some output from ncval. In general, we typically don't see validation failures except in assembly code, so you may want to see if there were any .s files added in the transition between 0.2.6 and 0.2.7
 

The only solution seem to be go through diff between branches of tor and look at modified files one by one.

I would be glad if anyone can suggest better method to pin-point the problem.

----
sel_ldr behavior seems weird in case of libevent port, tried sample/hello-world.nexe and it says socketpair not implemented, however ifdef was added in the code to fallback on different implementation of socketpair, the same binary works if loaded as chroma app verifying the correctness of code. Any suggestions.
----
As a side note, devenv port is not building, the webstore version is also not working.
--- 
pepper_49 , sdk and ports both with chrome stable ver 48.

--
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 https://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

Deepankar Tyagi

unread,
Dec 18, 2016, 4:33:24 PM12/18/16
to Native-Client-Discuss, Ben Smith
Thanks for the response.
(Apologies for not getting back in time, was unsubscribed to the group)
------------------------
After the chrome apps phasing out announcement was made, starting attempt to compile it for pnacl.
On Nov 26 was finally able to compile and run it successfully. It was working on chrome running on all platforms.
-------------------------
But Chrome 55 update broke it. It crashes at "pnacl-translate stage" itself. (It seems like a lot has changed in 55 in context of nacl , devenv is also crashing)
Here are few things which I have tried till now.
  • Tried gdb debugging as mentioned on this page on chrome website. Outcome : nothing of use, closest I got was this message "0x000000000fdc35a0 in ?? ()"
  • Tried to compile and run just a printf hello world example, still crashes.
  • Most helpful message was "evsig_init: socketpair: Permission denied"  in console  while running hello world example of libevent.
------------------------
Questions:
  1. Does pnacl supports sockets?
  2. Pnacl can be loaded from a webpage, how does one ask for storage space permission there ?
  3. Any help or documentation on how to debug pncal-translator ?
  4. If compiled with clang-newlib then validation error pops up, ncval says instruction not recognised, objdump reveals that the instruction is "movdqa", if a particular instruction is not supported by IRT then why does compile emits it?

On Friday, March 25, 2016 at 12:06:18 AM UTC+5:30, Ben Smith wrote:
On Sun, Mar 13, 2016 at 12:15 AM, Deepankar Tyagi <nonfa...@gmail.com> wrote:
Hi everyone,

A few months back libevent and Tor were ported to NaCl platform, at the time tor's version was 0.2.6, I wanted to update the port to tor's latest version ie 0.2.7

However I am stuck, the issue is of validation failure, tried to run sel_ldr in debug mode, still no success, tried with ncval, no output.

This is surprising, I'd assume you'd get some output from ncval. In general, we typically don't see validation failures except in assembly code, so you may want to see if there were any .s files added in the transition between 0.2.6 and 0.2.7
 

The only solution seem to be go through diff between branches of tor and look at modified files one by one.

I would be glad if anyone can suggest better method to pin-point the problem.

----
sel_ldr behavior seems weird in case of libevent port, tried sample/hello-world.nexe and it says socketpair not implemented, however ifdef was added in the code to fallback on different implementation of socketpair, the same binary works if loaded as chroma app verifying the correctness of code. Any suggestions.
----
As a side note, devenv port is not building, the webstore version is also not working.
--- 
pepper_49 , sdk and ports both with chrome stable ver 48.

--
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.

Derek Schuff

unread,
Jan 3, 2017, 4:08:55 PM1/3/17
to native-cli...@googlegroups.com, Ben Smith
On Sun, Dec 18, 2016 at 1:33 PM Deepankar Tyagi <nonfa...@gmail.com> wrote:
Thanks for the response.
(Apologies for not getting back in time, was unsubscribed to the group)
------------------------
After the chrome apps phasing out announcement was made, starting attempt to compile it for pnacl.
On Nov 26 was finally able to compile and run it successfully. It was working on chrome running on all platforms.
-------------------------
But Chrome 55 update broke it. It crashes at "pnacl-translate stage" itself. (It seems like a lot has changed in 55 in context of nacl , devenv is also crashing)
Here are few things which I have tried till now.
  • Tried gdb debugging as mentioned on this page on chrome website. Outcome : nothing of use, closest I got was this message "0x000000000fdc35a0 in ?? ()"
  • Tried to compile and run just a printf hello world example, still crashes.
  • Most helpful message was "evsig_init: socketpair: Permission denied"  in console  while running hello world example of libevent.
------------------------
Questions:
  1. Does pnacl supports sockets?
I don't believe so.
 
  1. Pnacl can be loaded from a webpage, how does one ask for storage space permission there ?
I'm not sure about this one. 
  1. Any help or documentation on how to debug pncal-translator ?
That's tough to do in the browser; it would be easier if it could be reproduced in the toolchain; e.g. if you use the offline pnacl-translate tool from the latest SDK, do you get the same behavior? Also, are you using optlevel:0 (if not, i'd recommend doing that anyway)? 
  1. If compiled with clang-newlib then validation error pops up, ncval says instruction not recognised, objdump reveals that the instruction is "movdqa", if a particular instruction is not supported by IRT then why does compile emits it?

IIRC movdqa is an allowed instruction, although there could be validation failures if its operands are not properly sandboxed. AFAIK the compiler should support using that instruction correctly; it's hard to say whether or what kind of bug it might be without seeing the output code. It's also possible that using clang-newlib instead of PNaCl results in some assembly code being included in the build, which may compile successfully but fail validation, since it wasn't written for NaCl.
Reply all
Reply to author
Forward
0 new messages