gdb receives SIGTTOU even if -tostop

I’m debugging dovecot, and didn’t find a tiny example for reproduce it rather than dovecot itself.
Try running gdb /usr/lib/dovecot/managesieve and then type r to run it, soon GDB will get stopped. For bash it doesn’t report the reason (signal) for stopping gdb, but sh does, and states it’s becuase SIGTTOU.
I’ve searched about it and all says if stty -tostop is run it shouldn’t happen. I checked the default setting to be -tostop, and to be sure ran stty -tostop again. But non of them helps. GDB still gets stopped.
Any help?

Although your openSUSE versions are slightly different, you’re both posting about dovecot authentication problems on Gnome approximately the same time, I wonder if your posts are related? See if you can replicate what was posted in this other thread

https://forums.opensuse.org/showthread.php/536322-gkr-pam-unable-to-locate-daemon-control-file

TSU

Hi, thank you for your reply. I’m afraid my problem has no relation to the one in the link.
Anyway I just want to solve problem on SIGTTOU. This is also the reason I’m not posting any details about my dovecot problem. Instead, I’ve posted them on dovecot’s maillist.