Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't accidentially generate trigraphs in filewrapper #17

Conversation

MackieLoeffel
Copy link

@MackieLoeffel MackieLoeffel commented Mar 25, 2019

When trying out this library, I ran into the problem of the sandboxee crashing with the following error on optimized builds (debug builds worked fine):

[comms.cc : 561] RAW: read: Connection reset by peer [104]
[forkserver.cc : 96] RAW: Receiving init PID from the ForkServer failed
WARNING: Logging before InitGoogleLogging() is written to STDERR
E0325 13:18:53.440409 13504 executor.cc:157] Could not obtain init PID
[comms.cc : 535] RAW: write: Bad file descriptor [9]
[forkserver.cc : 68] RAW: Sending PB to the ForkServer failed

I traced to problem down to a SIGSEGV, when spawning the embedded child and the problem turned out to be, that parts of the embedded data were interpreted as trigraphs by gcc. This PR fixes this problem by emitting \? instead of ? in the filewrapper.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added the cla: no CLA not accepted label Mar 25, 2019
@MackieLoeffel
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes CLA accepted and removed cla: no CLA not accepted labels Mar 25, 2019
cblichmann added a commit that referenced this pull request Mar 26, 2019
  - 05cbe12 Don't accidentially generate trigraphs by Mackie Loeffel <mackie.loeffel@web.de>
  - 25e66c1 Merge 05cbe12 into 6679f... by MackieLoeffel <MackieLoeffel@users.noreply.github.com>

COPYBARA_INTEGRATE_REVIEW=#17 from MackieLoeffel:fix_trigraphs_in_filewrapper 05cbe12
PiperOrigin-RevId: 240365879
Change-Id: I31fa5dfeadac3cee79e7d66b4dd4fe58a7a4b242
@cblichmann cblichmann closed this Mar 26, 2019
happyCoder92 pushed a commit that referenced this pull request May 4, 2022
  - 05cbe12 Don't accidentially generate trigraphs by Mackie Loeffel <mackie.loeffel@web.de>
  - 25e66c1 Merge 05cbe12 into 6679f... by MackieLoeffel <MackieLoeffel@users.noreply.github.com>

COPYBARA_INTEGRATE_REVIEW=#17 from MackieLoeffel:fix_trigraphs_in_filewrapper 05cbe12
PiperOrigin-RevId: 240365879
Change-Id: I31fa5dfeadac3cee79e7d66b4dd4fe58a7a4b242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants