Package: libevent-2.1-7
Version: 2.1.11-stable-1
Severity: important

Hello,

what I report is a heisenbug. It seems to be within libevent itself and it was 
hard to catch.
That means:
Building my code with -g or without -g (and -O3) does not make much difference.
What does make a difference:
When debugger was attached, it did not reveal itself.
When valgrind was attached (default or drd), it has shown something but those 
were only minor issues _after_ the actual problem has happened.
Running in strace has hidden the problem as well.
Activating all my internal trace points (lots of STDERR writes) has also made 
the problem disappear.

Eventually I found it by adding just a few STDERR outputs here and there.

And it seems that evbuffer_write_atmost returns -1 for no reason. Not always 
but randomly.
At the same time, some weird errno like 2 is returned which seemed not to make 
any sense at all.
Until I realized that it is the errno from some previous syscall.

I can set errno to something like 42 before calling evbuffer_write_atmost and 
it is not updated although -1 is returned.

Please have a look and find the root cause. Thank you.

For the details of this bug hunt, feel free to check 
https://salsa.debian.org/blade/apt-cacher-ng/-/commit/e5c6ff61cb02bc7db9368a219994212fc42868aa

Best regards,
Eduard.
-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental-debug'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.6.0+ (SMP w/12 CPU cores)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libevent-2.1-7 depends on:
ii  libc6  2.30-2

libevent-2.1-7 recommends no packages.

libevent-2.1-7 suggests no packages.

-- no debconf information

--
Eigentlich bestechen gegen die Wahrheit rechtlose Beleidigungen weit
mehr als rechtlose Schmeicheleien.
                -- Jean Paul

Reply via email to