Re: libksane seems to break QProcess::start calls

2022-03-05 Thread Thiago Macieira
On Saturday, 5 March 2022 00:31:43 PST Tobias Leupold wrote: > f it's only the SANE backend that breaks this, you're of course right. Unfortunately, we can't be sure of that. It's hard to get Unix signals right (we're discussing another instance of it in Qt right now, on [1]) > Within what I

Re: libksane seems to break QProcess::start calls

2022-03-05 Thread Tobias Leupold
> It shouldn't have any side-effects. In fact, the code exists to *avoid* > side-effects in the first place. > > Of course, it assumes that there isn't buggy code elsewhere. If there is, > then all bets are lost. I'm not going to document how to bugfix other code, > especially complex code like

Re: libksane seems to break QProcess::start calls

2022-03-04 Thread Thiago Macieira
On Friday, 4 March 2022 13:47:07 PST Tobias Leupold wrote: > I don't know if this would be still possible for the Qt 5 docs, but a small > hint like "If you subclass this, be aware that ..." woudn't hurt ... As > said, I would never have thought that this would have such side-effects! It

Re: libksane seems to break QProcess::start calls

2022-03-04 Thread Tobias Leupold
> It's a side-effect. The problem is the QProcess::setupChildProcess virtual > in Qt 5, that had been there since QProcess was introduced the the > Paleolithic Era. When we use CLONE_PIDFD, we have to call clone() directly, > which means the hooks installed by pthread_atfork() do not get run. In >

Re: libksane seems to break QProcess::start calls

2022-03-04 Thread Thiago Macieira
On Friday, 4 March 2022 10:52:00 PST Tobias Leupold wrote: > I simply made this a QObject subclass and rather then using start() etc. > directly, I created a QProcess object and did the same stuff with this one. > > No freezes anymore. No matter what scanner I use. > > I never thought

Re: libksane seems to break QProcess::start calls

2022-03-04 Thread Tobias Leupold
Hey Thiago, Am Freitag, 4. März 2022, 18:35:23 CET schrieb Thiago Macieira: > And this is the reason why you got the symptom of QProcess breaking. We'd > have expected that the eight mention be the same as the fifth, to keep the > pattern going, but it isn't. It's the same as the second and sixth

Re: libksane seems to break QProcess::start calls

2022-03-04 Thread Thiago Macieira
On Friday, 4 March 2022 09:02:37 PST Thiago Macieira wrote: > > I uploaded the traces here: > > https://l3u.de/tmp/strace_brscan.txt.xz > > https://l3u.de/tmp/strace_plustek.txt.xz > > > > Thanks again for all help! > > I'll take a look. Let's see... the brscan trace doesn't have any use of >

Re: libksane seems to break QProcess::start calls

2022-03-04 Thread Thiago Macieira
On Thursday, 3 March 2022 23:32:11 PST Tobias Leupold wrote: > I did it like this. I created one strace for the scanner not causing > problems and scanned two pages. This resulted in 27,096 lines of output. > > Then I created one for the scanner causing the issue, also scanning two > pages. This

Re: libksane seems to break QProcess::start calls

2022-03-03 Thread Tobias Leupold
Hi Thiago and all, thanks a lot for the input so far! I'm really a bit lost here ... Am 04.03.22 um 01:06 schrieb Thiago Macieira: > Fix the problem where the problem is. I would really love to, esp. if this could be some upstream issue. And if not, I'd also love to fix it ;-) You can

Re: libksane seems to break QProcess::start calls

2022-03-03 Thread Thiago Macieira
On Thursday, 3 March 2022 11:00:07 PST Tobias Leupold wrote: > Am Donnerstag, 3. März 2022, 19:06:21 CET schrieb Stefan Brüns: > > Are you using either Qt5 < 5.15 or a kernel version which does not support > > CLONE_FD? - then you are relying on SIGCHLD for process exit notification. > > > >

Re: libksane seems to break QProcess::start calls

2022-03-03 Thread Tobias Leupold
Am Donnerstag, 3. März 2022, 19:06:21 CET schrieb Stefan Brüns: > Are you using either Qt5 < 5.15 or a kernel version which does not support > CLONE_FD? - then you are relying on SIGCHLD for process exit notification. > > CLONE_FD: https://lwn.net/Articles/636646/ > Qt5:

Re: libksane seems to break QProcess::start calls

2022-03-03 Thread Stefan Brüns
On Donnerstag, 3. März 2022 13:54:32 CET Tobias Leupold wrote: > Hi all :-) > > I have a very odd problem, and I have no idea what could cause this or even > how to debug this. maybe, someone of you can give me a hint. > > I revently wrote a small helper program for one special purpose: Scanning

Re: libksane seems to break QProcess::start calls

2022-03-03 Thread Tobias Leupold
Hi Klaas! > Interesting, I wrote a very similar little utility called PDFQuirk: > https://dragotin.github.io/quirksite/ Well, apparently, this is a quite common task to do ;-) > PDFQuirk has a very similar idea, yet it does not use libksane, but the > command line tool scanimage directly,

Re: libksane seems to break QProcess::start calls

2022-03-03 Thread Klaas Freitag
Am 03.03.22 um 13:54 schrieb Tobias Leupold: Hi Tobias, I have a very odd problem, and I have no idea what could cause this or even how to debug this. maybe, someone of you can give me a hint. I revently wrote a small helper program for one special purpose: Scanning documents at a defined

libksane seems to break QProcess::start calls

2022-03-03 Thread Tobias Leupold
Hi all :-) I have a very odd problem, and I have no idea what could cause this or even how to debug this. maybe, someone of you can give me a hint. I revently wrote a small helper program for one special purpose: Scanning documents at a defined size, post processing them a bit and saving the