Skip to content

Unable to start profiling: TypeError: Cannot read properties of undefined (reading 'frames')Β #282

@m0ppers

Description

@m0ppers

somehow I hit this problem. at a specific section in my (rather simple) demo I cannot profile. When hitting the profile (single) button I am getting this error. I have tried to debug what is going on up to a certain point.

the problematic section in the code is profileTimeFrame()

					const l = this.sourceMap.uniqueLines[this.sourceMap.lines[pc >> 1]];
					if (l === undefined) {
console.log(pc >> 1);
console.log(Object.keys(this.sourceMap.lines));
console.log(this.sourceMap.lines[pc >> 1]);
					// console.log(this.sourceMap.uniqueLines);
					for (let i = l.frames.length - 1; i >= 0; i--) {
						callstack.frames.unshift({ ...l.frames[i] });
						if (i !== 0)
							callstack.frames[0].func += " (inlined)";
					}
				}

I have hacked the specific section and the problem is that l is undefined. so iterating l.frames will just throw this error.

this is the output that I am seeing in the console using this thing:

-52921
(2051) ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', …]
undefined

From what I get the extension does some raw snapshot and then converts it into json and that seems to fail. I have found some raw data in the /tmp folder which I hope is the right stuff and eventually helpful πŸ™

in a later section of the demo profiling works. it is totally possible that I have a bug in my code that is why I wanted to have a look in the profiler πŸ˜‚ maybe this possible bug triggers something.

broken.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions