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

If an error occurs during an exec call, we get empty output #41

Open
fpapadopou opened this issue Sep 29, 2015 · 0 comments
Open

If an error occurs during an exec call, we get empty output #41

fpapadopou opened this issue Sep 29, 2015 · 0 comments
Labels

Comments

@fpapadopou
Copy link
Contributor

Issue description and reproduction steps

When providing G++ or Clang with parameter files that contain parentheses in their names, PHP's exec function breaks and you get sth like this on the stderr output (caught in command line):

sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `avr-g++ -Os -ffunction-sections -fdata-sections -fno-exceptions  -I/arduino-core-files-OSX/v105/hardware/tools/avr/lib/gcc/avr/4.3.2/include -I/arduino-core-files-OSX/v105/hardware/tools/avr/lib/gcc/avr/4.3.2/include-fixed -I/arduino-core-files-OSX/v105/hardware/tools/avr/avr/include  -mmcu=atmega328p -DARDUINO=105 -DF_CPU=16000000 -DUSB_VID=null -DUSB_PID=null -MMD  -I/external_cores/override_cores/arduino/ -I/arduino-core-files-OSX/v105/hardware/arduino/cores/arduino -I/arduino-core-files-OSX/v105/hardware/arduino/variants/standard -I/tmp/compiler.elVKPg/libraries/Ethernet(3) -c -o '/tmp/compiler.elVKPg/files/Blink'.o '/tmp/compiler.elVKPg/files/Blink'.cpp 2>&1'
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `LD_LIBRARY_PATH=/arduino-core-files-OSX/clang/v3_5/lib:$LD_LIBRARY_PATH /usr/bin/clang --target=msp430 -w -fsyntax-only -fcolor-diagnostics  -I/arduino-core-files-OSX/v105/hardware/tools/avr/lib/gcc/avr/4.3.2/include -I/arduino-core-files-OSX/v105/hardware/tools/avr/lib/gcc/avr/4.3.2/include-fixed -I/arduino-core-files-OSX/v105/hardware/tools/avr/avr/include  -D__AVR_ATmega328P__ -DARDUINO=105 -DF_CPU=16000000  -I/external_cores/override_cores/arduino/ -I/arduino-core-files-OSX/v105/hardware/arduino/cores/arduino -I/arduino-core-files-OSX/v105/hardware/arduino/variants/standard -I/tmp/compiler.elVKPg/libraries/Ethernet(3) -c -o '/tmp/compiler.elVKPg/files/Blink'.o '/tmp/compiler.elVKPg/files/Blink'.cpp 2>&1'

Notice the -I/tmp/compiler.elVKPg/libraries/Ethernet(3) part in both avr-g++ and Clang commands.

As a result, both compilers end up with a syntax error, never executing the requested command.

We do redirect stderr to stdout using 2>&1 in the end of all commands provided to PHP's exec, however this doesn't work for such cases.

Need to find a way to catch this output.

@fpapadopou fpapadopou added the bug label Sep 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant