0

Google's dump_syms program requires an input file and an output file to write the symbolicated file such as:

$ dump_syms ./test.so > test.so.sym

I have the binary of the test.so in the memory buffer. It doesn't play well with performance if I first write the binary to a temp file then feed it to the dump_syms then delete this temp source.

Is it possible to somehow directly pipe the binary data into the dump_syms in order to bypass the file system? I believe there must be a way maybe from Linux's native piping perspective to do this.

I know that the best way would be for the dump_syms to support piping, but I suppose it doesn't have this feature. Considering this, if there are any tip to, perhaps, modify the dump_syms to accept the pipe, I would love to hear that as well.

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
esengineer
  • 9,514
  • 7
  • 45
  • 69

1 Answers1

1

You can make a "named pipe," then pass its name (which will be a path on the filesystem) to dump_syms. Whether dump_syms will still work I can't say, because it may require random access which the pipe will not support.

Alternatively, if you can control where in memory you store the buffer in the first place, you could mmap a file, use that memory region to store the data, then give the name of that memory-mapped file to dump_syms.

John Zwinck
  • 239,568
  • 38
  • 324
  • 436
  • Sounds nice. I will try and comment back. Thank you for the quick reply. – esengineer Nov 10 '14 at 07:22
  • Voted up the answer though it hasn't helped eventually. First, named piping isn't suitable for `dump_syms` because it needs to map the source file into the memory via `mmap` which isn't possible in named pipe's case. Second, using the memory mapping in Node.js isn't straightforward and implies blocking operations. The only way possible I think right now is by directly modifying the `breakpad`'s source code to read the piped data. – esengineer Nov 10 '14 at 09:40
  • @Eye. OK. I guess the "crazy" optimized solution would be to get the functionality you need as a library instead of a separate executable; then you could simply operate on the memory you already have. Might not be easy though. – John Zwinck Nov 11 '14 at 00:16
  • Yes, I agree with that. Currently though we don't have resources to spend time on porting breakpad into Node.js NPM module. That would be the best solution I'm sure. – esengineer Nov 11 '14 at 01:37