i3 / i3/i3

Developing i3 inside an i3 session breaks the IPC socket of the outer session

Open
#4,381 5 comments 1 reaction 0 assignees View on GitHub
4.19 bug missing-log
Dominant language
C
Stars
10.6k
Forks
822
PR merge metrics
No merged PRs in 30d

Description

Okay, before the discussion in https://github.com/i3/i3/issues/4380#issuecomment-796611526 ends up "stealing" the issue, let's move this here.

## I'm submitting a…

[x] Bug

[ ] Feature Request
[ ] Documentation Request
[ ] Other (Please describe in detail)

## Current Behavior

```
$ LC_ALL=C i3 --moreversion
Binary i3 version: 4.19.1-non-git © 2009 Michael Stapelberg and contributors
(Getting version from running i3, press ctrl-c to abort…)i3: Could not connect to i3 on socket /run/user/1000/i3/ipc-socket.709: No such file or directory
```

## Expected Behavior

```
Binary i3 version: 4.19.2-73-gaf2171d0+ © 2009 Michael Stapelberg and contributors
Running i3 version: 4.19.2-73-gaf2171d0+ (pid 360305)
Loaded i3 config: /home/psychon/.config/i3/config (Last modified: Mo 08 Mär 2021 16:11:41 CET, 240617 seconds ago)

The i3 binary you just called: /home/psychon/projects/i3/build/i3
The i3 binary you are running: ./build/ychon/projects/i3/build/i3
```

## Reproduction Instructions

Run `i3`. `git clone` this repo inside such a session and run it as `Xephyr :1 & sleep 1 ; DISPLAY=:1 ./build/i3`.

(Note: I did not actually test whether the above breaks the IPC socket, but I guess so a lot)

## Why this happens

The outer i3 session sets `I3SOCK` when starting processes: https://github.com/i3/i3/blob/af2171d01d40613ec8e6eddcc148722b0ec248f9/src/startup.c#L193

The inner i3 session gets this environment variable and unlinks the socket: https://github.com/i3/i3/blob/af2171d01d40613ec8e6eddcc148722b0ec248f9/src/main.c#L647-L653

https://github.com/i3/i3/blob/af2171d01d40613ec8e6eddcc148722b0ec248f9/libi3/create_socket.c#L37-L38

## Environment

Output of `i3 --moreversion 2>&-`:

i3 version: 

Heh. Does i3bot pick up the output above or will it complain about missing version information?

Config file

Doesn't matter, I bet.

Logfile URL:

Sorry, no

- Linux Distribution & Version: Debian testing

- Are you using a compositor (e.g., xcompmgr or compton): no

Edit:

## What are you guys doing?

Why did no one else ever run into this?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.