Community
Participate
Working Groups
Build Identifier: 4.7.1.1 When executing the command: -agentpath:'org.eclipse.tptp.platform.jvmti.runtime_4.6.2.v201009281431/agent_files/linux_ia32/libJPIBootLoader.so=JPIAgent:server=standalone,file=;ProbekitAgent:ext-pk-BCILibraryName=BCIEngProbe,ext-pk-probescript=/temp/t1/psfile1' The following trace is printed to the console: <?xml version="1.0"?> <TRACE> <node nodeId="" hostname="localhost" ipaddress="127.0.0.1" timezone="240" time="1288022657.927753000"/> <processCreate processId="D8B51F37-A16D-4DBB-98FB-F5EE60EE0590" pid="10885" nodeIdRef="" time="1288022657.927753000"/> <agentCreate agentId="E55291F5-8E07-47D6-8F2E-F604371F61C3" version="2.000" processIdRef="D8B51F37-A16D-4DBB-98FB-F5EE60EE0590" agentName="org.eclipse.tptp.jvmti" agentType="Profiler" agentParameters="server=standalone,file=" time="1288022657.927753000"/> <traceStart traceId="04BC7B2F-D3F8-45AE-9BF4-07E917DB10B7" agentIdRef="E55291F5-8E07-47D6-8F2E-F604371F61C3" time="1288022658.181815000"/> <option key="FILTERS" value="true"/> <option key="OPTIONS" value="true"/> <option key="STACK_INFORMATION" value="normal"/> <option key="TICKET" value="true"/> <option key="TIMESTAMPS" value="true"/> <option key="TRACE_IDREFS" value="false"/> <option key="CPU_TIME" value="false"/> This trace does not affect the functionality of the agent, which other than this behaves normally. Only found on Linux (tried Red Hat 5.5 and reproduced on 2 different machines). When redirecting the stdout of the command to a file using the > operator, the trace still shows in the console so I assume its being printed to stderr. Reproducible: Always
It's actually being printed to stdout; and the reason is that the given command specifies: 'file='. The output intialization code specifically detects a blank filename (ECJvmtiAgent.cpp:175) and simply skips opening the file. The result is that the file handle retains its default value (i.e. 0) which on Unix platforms is equal to stdout. Unsure how this behaves on Windows, but it would either be the same or simply no output. Seems this can be handled either by not filtering the blank filename, which likely results in an error that the output file could not be opened; or an alternative branch could be added that falls back to the default file name. Containable for 4.7.2.
Correction, file descriptor 0 is the stdin file descriptor. Strangely on Linux it seems to be that if you write() to stdin it appears on the console. Allowing an empty filename to bypass initializing the output file was added for bug 296510. I think the fix here simply needs to prevent calling write() if the file descriptor has not been initialized.
Created attachment 184260 [details] Patch Attached patch that skips write()ing to the file handle if it is uninitialized.
Checked into HEAD.
This defect had been resolved as FIXED for more than 1 month. Please verify with the latest TPTP 4.7.2 driver. If this defect is still left unverified by February 25, we'll close it on the originator's behalf. TPTP 4.7.2 driver can be downloaded from: http://www.eclipse.org/tptp/home/downloads/?ver=4.7.2
Verified in TPTP 4.7.2