Yourkit Profiler Agent creates snapshot directory with a carriage return character at the end

Questions about YourKit Java Profiler
Locked
tklock
Posts: 4
Joined: Tue Feb 07, 2023 6:10 pm

Yourkit Profiler Agent creates snapshot directory with a carriage return character at the end

Post by tklock »

Hello Yourkit support team,

We customized our snapshot directory by adding the following line in our <user home>/.yjp/snapshotdir.txt file on our Linux server:

Code: Select all

[20230426#10:30:19 - myuser@myserver:~/.yjp] file snapshotdir.txt
snapshotdir.txt: ASCII text
[20230426#10:31:03 - myuser@myserver:~/.yjp] cat snapshotdir.txt
/test/Snapshots
[20230426#10:31:08 - myuser@myserver:~/.yjp]
And Yourkit creates automatically this /test/Snapshots directory with a question mark at the end. It seems that the character isn't a question mark but ls's way of telling us there is an unprintable character like a carriage return character (CR, commonly represented as \r or \015 or ^M) :

Code: Select all

[20230426#10:34:02 - myuser@myserver:/test] ll
total 1252
drwxrwxr-x  9 myuser mygroup    4096 Apr 26 11:01 .
drwxr-xr-x  3 myuser mygroup    4096 Apr 19  2012 ..
drwxrwxr-x  2 myuser mygroup    4096 Apr 26 11:01 Snapshots?
drwxr-xr-x  7 myuser mygroup    4096 Dec 31  2018 YourKit-JavaProfiler-2018.04
[20230426#10:34:28 - myuser@myserver:/test] cd 'Snapshots
'/

[20230426#10:34:54 - myuser@myserver:/test/Snapshots]
Yourkit continues to create this directory with carriage return character even though we rename it :(

Do you know how can we remove this carriage return character and force Yourkit to not add it to our snapshot directory ?

We use YourKit Java Profiler UI v2018.04-b88 on Windows 10 with Java v1.8.0_172 64 bit and YourKit Java Profiler Agent v2018.04 on Linux Red Hat Enterprise Linux v2.6.32-504.el6.x86_64.
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Yourkit Profiler Agent creates snapshot directory with a carriage return character at the end

Post by Anton Katilin »

Hi,

We have reproduced the problem. Indeed, the EOL is not properly truncated as it should be. We'll fix this.
Do you know how can we remove this carriage return character and force Yourkit to not add it to our snapshot directory ?
Please open the file in a text editor and ensure that the end-of-line character is truncated. In most visual editors you can put the caret after the last character of the path and press Del.

Or use a command like this one:

tr -d "\n" <old_file.txt >new_file.txt

Best regards,
Anton
tklock
Posts: 4
Joined: Tue Feb 07, 2023 6:10 pm

Re: Yourkit Profiler Agent creates snapshot directory with a carriage return character at the end

Post by tklock »

Indeed :

Code: Select all

[20230427#01:39:20 - myuser@myserver:~/.yjp] cat -e snapshotdir.txt.old
/test/Snapshots$
[20230427#01:40:46 - myuser@myserver:~/.yjp] cat -e snapshotdir.txt
/test/Snapshots[20230427#01:40:59 - myuser@muserver:~/.yjp]
The command "tr -d "\n" <old_file.txt >new_file.txt" did the job, thank you very much for the help ! 8)
Locked