Closed Bug 1461300 Opened 6 years ago Closed 6 years ago

Importing a snapshot file is broken when it's located in a directory with unicode characters

Categories

(DevTools :: Memory, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1382493

People

(Reporter: julienw, Unassigned)

Details

STR:
1. Open the memory tool.
2. Take a snapshot.
3. Save the snapshot.
4. Import the saved snapshot
=> Error

There's a stacktrace printed:

Error while performing task "readHeapSnapshot": [Exception... "File error: Not found"  nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame :: resource://devtools/shared/heapsnapshot/HeapAnalysesWorker.js :: <TOP_LEVEL> :: line 50"  data: no]
@resource://devtools/shared/heapsnapshot/HeapAnalysesWorker.js:50:5
createHandler/<@resource://devtools/shared/worker/helper.js:85:24

I'm on Linux, using latest Nightly.
I'm not sure it ever worked, actually...
Ah, it works when I copy the file in another directory.
My original directory had some unicode characters ("é"). Could that be the reason ?
I can confirm this bug. It is because of the é.

STR:

 * Create a folder called "é"
 * Save a snapshot to that folder
 * Load the snapshot from that folder

ER:

 * The snapshot loads

AR:

 * The file can not be found with the following error:

> readSnapshot threw an exception: Error while performing task "readHeapSnapshot": [Exception... "File error: Not found"  nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)"  location: "JS frame :: resource://devtools/shared/heapsnapshot/HeapAnalysesWorker.js :: <TOP_LEVEL> :: line 50"  data: no]
> @resource://devtools/shared/heapsnapshot/HeapAnalysesWorker.js:50:5
> createHandler/<@resource://devtools/shared/worker/helper.js:85:24
fitzgen: It looks like this is not correctly handling the text parsing (is it unicode?) when loading in a file. Do you have any insight into what the fix would be?

https://searchfox.org/mozilla-central/rev/a85db9e29eb3f022dbaf8b9a6390ecbacf51e7dd/devtools/shared/heapsnapshot/HeapSnapshot.cpp#1666
Flags: needinfo?(nfitzgerald)
Priority: -- → P2
Summary: Importing a snapshot is broken → Importing a snapshot file is broken when it's located in a directory with unicode characters
So I think this is an encoding problem somewhere. I'm quite sure my filesystem uses Unicode, but other filesystems might use other encodings. We need to make sure we keep the underlying "byte-correct" name from where the user selects the file to where we load it. Do you know where the code to select the file is?
We call it from JS, so I assume it is using JS encoding, which is ~UTF-16.
Flags: needinfo?(nfitzgerald)
Product: Firefox → DevTools
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.