question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Segmentation Fault when retrieving window title

See original GitHub issue

Version Node v17.0.1 nut.js v2.0.1

Short overview Trying to retrieve title of any window results in Seg Fault and no other information, program ends immediately.

Issue occurs on

  • Virtual machine
  • Docker container
  • Dev/Host system

Detailed error description Seg fault is occurring on Big Sur any time I attempt to find a window title, either through getWindows or getActiveWindow.

Steps to reproduce error Run this script:

import { getActiveWindow } from '@nut-tree/nut-js';

(async () => {
    const window = await getActiveWindow();
    const title = await window.title;
    console.log(title);
})();

Expected Result: Terminal

Actual Result: zsh: segmentation fault node index.js

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
s1hofmanncommented, Sep 22, 2022

Root cause: Reading the kCGWindowName property requires an application to be given Screen Recording permissions. If this is not the case, it’ll just return nil which caused the segfault.

Fixed in release 2.3.0 that just went live.

1reaction
s1hofmanncommented, Sep 19, 2022

Status update:

This issue had me banging my head for several months now. I might have finally tracked down the root cause 💪

Still WIP

Read more comments on GitHub >

github_iconTop Results From Across the Web

Segmentation Fault when retrieving value from pointer in ...
in C, when calling malloc() , 1) do not cast the returned value as it is a void* so can be assigned to...
Read more >
Segmentation fault - Wikipedia
Segmentation faults are a common class of error in programs written in languages like C that provide low-level memory access and few to...
Read more >
Identify what's causing segmentation faults (segfaults)
A segmentation fault (aka segfault) is a common condition that causes programs to crash; they are often associated with a file named core...
Read more >
Why is rasterio getting a segmentation fault trying to read a ...
My code with the segfault was using ... with rasterio.open(orig_data_file) as f: data = f.read(1, window=window).
Read more >
Debugging Segmentation Faults - Google Sites
Segmentation faults are referred to as segfault, access violation or bus error. Hardware notifies the operating system about memory access violation. The OS ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found