Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected write() failure on attempt to write #1734

Open
tuvok81 opened this issue Jan 10, 2025 · 7 comments
Open

Unexpected write() failure on attempt to write #1734

tuvok81 opened this issue Jan 10, 2025 · 7 comments

Comments

@tuvok81
Copy link

tuvok81 commented Jan 10, 2025

i have no idea why he is doing this ..
he have enought hdd/ssd on the vm and the access rights are also correct its a eggdrop-1.10.0

[18:46] [18:46:59] Connected to irc.belwue.de
[18:46] [18:46:59] -NOTICE- Server is currently in split-mode.
[19:00] [19:00:00] Schreibe Benutzerdatei...
[19:00] [19:00:00] Writing channel file...
[20:00] [20:00:00] Schreibe Benutzerdatei...
[20:00] [20:00:00] Writing channel file...
[20:16] [20:16:29] Unexpected write() failure on attempt to write 36 bytes to fd 1: Input/output error.
[20:16] [20:16:29] Unexpected write() failure on attempt to write 67 bytes to fd 1: Input/output error.
[21:00] [21:00:00] Schreibe Benutzerdatei...
[21:00] [21:00:00] Unexpected write() failure on attempt to write 37 bytes to fd 1: Input/output error.
[21:00] [21:00:00] Writing channel file...
[21:00] [21:00:00] Unexpected write() failure on attempt to write 35 bytes to fd 1: Input/output error.

@michaelortmann
Copy link
Member

You could try strace (strace ./eggdrop -t ...) to see the filename opened for writing and see if any close(), unlink() or rename() functions fail before the write() error shows.

For those user- and chan-files, eggdrop should open <filename>~new, then write, then close, then unlink (=remove) <filename> and then finally rename <filename>~new to <filename>

@michaelortmann
Copy link
Member

michaelortmann commented Jan 11, 2025

Additionally chan.mod also writes bans/exempts/invites to <userfilename>~new(). In this case the file is closed and instantly reopened.

@michaelortmann
Copy link
Member

Also there is an eggdrop setting userfile-perm that is applied to new files created by eggdrop. This setting can be changed on the fly. So one of my very wild guesses is, that if you set userfile-perm to world-writeable, some VM policy could detect some forbidden behaviour and hardkill the file or something? But im very very wild guessing here.

@tuvok81
Copy link
Author

tuvok81 commented Jan 11, 2025

You could try strace (strace ./eggdrop -t ...) to see the filename opened for writing and see if any close(), unlink() or rename() functions fail before the write() error shows.

For those user- and chan-files, eggdrop should open <filename>~new, then write, then close, then unlink (=remove) <filename> and then finally rename <filename>~new to <filename>

this is my strace
16:50:01.124732 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1601405, si_uid=1003} ---
16:55:01.147541 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1847721, si_uid=1003} ---
17:00:01.166837 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2094300, si_uid=1003} ---
17:05:01.189143 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2340013, si_uid=1003} ---
17:10:01.220013 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2586578, si_uid=1003} ---
17:15:01.241473 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2832719, si_uid=1003} ---
17:20:01.276237 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3077799, si_uid=1003} ---
17:25:01.295642 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3320325, si_uid=1003} ---
17:30:01.326778 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3561206, si_uid=1003} ---
17:35:01.345228 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3804791, si_uid=1003} ---
17:40:01.375110 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=4050945, si_uid=1003} ---
17:45:01.395526 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=105778, si_uid=1003} ---
17:50:01.416032 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=353957, si_uid=1003} ---
17:55:01.435362 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=601421, si_uid=1003} ---
18:00:01.463909 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=849496, si_uid=1003} ---
18:05:01.489617 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1096112, si_uid=1003} ---
18:10:01.521574 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1342024, si_uid=1003} ---
18:15:01.546085 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1587144, si_uid=1003} ---
18:20:01.599773 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1831540, si_uid=1003} ---
18:25:01.622958 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2077400, si_uid=1003} ---
18:30:01.682137 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2323532, si_uid=1003} ---
18:35:01.714248 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2570464, si_uid=1003} ---
18:40:01.743376 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2818722, si_uid=1003} ---
18:45:01.783781 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3066440, si_uid=1003} ---
18:50:01.810484 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3315428, si_uid=1003} ---
18:55:01.839597 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3564074, si_uid=1003} ---
19:00:01.882925 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3811866, si_uid=1003} ---
19:05:01.909600 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=4058257, si_uid=1003} ---
19:10:01.944986 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=114065, si_uid=1003} ---
19:15:01.980821 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=360474, si_uid=1003} ---
19:20:02.023587 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=607200, si_uid=1003} ---
19:25:01.042882 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=850912, si_uid=1003} ---
19:30:01.064299 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1097014, si_uid=1003} ---
19:35:01.082345 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1344090, si_uid=1003} ---
19:40:01.110137 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1591696, si_uid=1003} ---
19:45:01.131375 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1839390, si_uid=1003} ---
19:50:01.150684 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2088496, si_uid=1003} ---
19:55:01.170903 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2335376, si_uid=1003} ---
20:00:01.199959 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2582097, si_uid=1003} ---
20:05:01.222215 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2824620, si_uid=1003} ---
20:10:01.253412 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3070450, si_uid=1003} ---
20:15:01.271313 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3317560, si_uid=1003} ---
20:20:01.301779 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3561157, si_uid=1003} ---
20:25:01.323403 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=3803487, si_uid=1003} ---
20:30:01.343130 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=4048211, si_uid=1003} ---
20:35:01.367145 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=99979, si_uid=1003} ---
20:40:01.401060 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=348476, si_uid=1003} ---
20:45:01.418053 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=594703, si_uid=1003} ---
20:50:01.439744 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=842258, si_uid=1003} ---
20:55:01.466899 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1092862, si_uid=1003} ---
21:00:01.495582 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1341508, si_uid=1003} ---
21:05:01.533760 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1587877, si_uid=1003} ---
21:10:01.597461 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=1833654, si_uid=1003} ---
21:15:01.662719 --- SIGCHLD {si_signo=SIGCHLD, si_code=SI_USER, si_pid=2081594, si_uid=1003} ---

@tuvok81
Copy link
Author

tuvok81 commented Jan 11, 2025

Also there is an eggdrop setting userfile-perm that is applied to new files created by eggdrop. This setting can be changed on the fly. So one of my very wild guesses is, that if you set userfile-perm to world-writeable, some VM policy could detect some forbidden behaviour and hardkill the file or something? But im very very wild guessing here.

i have do nothing on that

set userfile-perm 0600

@michaelortmann
Copy link
Member

I didnt see any SIGCHLD with eggdrop. eggdrop core doesnt fork child-processes. could be related to tcl scripts executing child processes? so maybe the whole issue is related to some script?

a "normal" strace of a user/chanfile save should look like:

write(1, "Saving user file...\n", 20Saving user file...
)   = 20
openat(AT_FDCWD, "BotA.user~new", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 8
chmod("BotA.user~new", 0600)            = 0
write(7, "[04:38:20] Writing user file...\n", 32) = 32
write(1, "[04:38:20] Writing user file...\n", 32[04:38:20] Writing user file...
) = 32
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=2298, ...}, 0) = 0
fstat(8, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
write(8, "#4v: eggdrop v1.10.0+pythonfixes"..., 3742) = 3742
close(8)                                = 0
openat(AT_FDCWD, "BotA.user~new", O_WRONLY|O_CREAT|O_APPEND, 0666) = 8
lseek(8, 0, SEEK_END)                   = 3742
fstat(8, {st_mode=S_IFREG|0600, st_size=3742, ...}) = 0
write(8, "*ban - -\n- %sadasd!asda@*:+0:+16"..., 177) = 177
close(8)                                = 0
openat(AT_FDCWD, "BotA.chan~new", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 8
chmod("BotA.chan~new", 0600)            = 0
write(7, "[04:38:19] Writing channel file."..., 35) = 35
write(1, "[04:38:19] Writing channel file."..., 35[04:38:19] Writing channel file...
) = 35
newfstatat(AT_FDCWD, "/etc/localtime", {st_mode=S_IFREG|0644, st_size=2298, ...}, 0) = 0
fstat(8, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
write(8, "#Dynamic Channel File for BotA ("..., 696) = 696
close(8)                                = 0
unlink("BotA.chan")                     = 0
rename("BotA.chan~new", "BotA.chan")    = 0
rename("BotA.user~new", "BotA.user")    = 0
pselect6(7, [0 4 5 6], NULL, NULL, {tv_sec=1, tv_nsec=0}, NULL) = 0 (Timeout)
pselect6(7, [0 4 5 6], NULL, NULL, {tv_sec=1, tv_nsec=0}, NULL) = 0 (Timeout)

@tuvok81
Copy link
Author

tuvok81 commented Jan 13, 2025

i have no scripts installed only the standard .. but for the moment the eggdrop run normal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants