SCM

[#300620] plustek: driver hangs when pthreads are used.

View Trackers | Bugs | Export CSV

Date:
2004-04-06 13:05
Priority:
3
State:
Closed
Submitted by:
Mattias Ellert (ellert-guest)
Assigned to:
Gerhard Jaeger (gja-guest)
Category:
backends (drivers)
Group:
Resolution:
Accepted
Summary:
plustek: driver hangs when pthreads are used.

Detailed description
The plustek driver hangs on platforms using pthreads (like e.g. MacOS X).

The reason for this has been identified as the following:

When the reader process is started with fork (like on linux), the file descriptors in the reader process are automatically closed when the reader process ends.

The read call in the main process then exits because the write end of the pipe was closed when the reader process exited.

However, when pthreads are used (like on MacOS X) the file descriptors are not closed when the reader thread ends, since in this case the file descriptors are shared between the threads.

The read call therefore never exits, since both ends of the pipe are still valid file descriptors.

(Note that this problem is not introduced by the workaround for the broken pthread_cancel call on MacOS X, but present on all platforms that uses threads.)

The attached patch has been tested and reportedly solves the problem.

For more information see the following thread on sane-devel:

http://lists.alioth.debian.org/pipermail/sane-devel/2004-April/010687.html
http://lists.alioth.debian.org/pipermail/sane-devel/2004-April/010698.html
http://lists.alioth.debian.org/pipermail/sane-devel/2004-April/010699.html
http://lists.alioth.debian.org/pipermail/sane-devel/2004-April/010701.html
http://lists.alioth.debian.org/pipermail/sane-devel/2004-April/010702.html

Followups: Sort comments antichronologically

Message
Date: 2004-04-09 12:26
Sender: Gerhard Jaeger

Logged In: YES user_id=2913Thanks for the report.
This bug is fixed in CVS now.

Attached Files:

Attachments:
Size Name Date By Download
432 bytessane-plustek.patch2004-04-06 13:05ellert-guestsane-plustek.patch

Changes:

Field Old Value Date By
status_idOpen2004-04-09 12:26gja-guest
ResolutionNone2004-04-09 12:26gja-guest
close_date2004-04-09 12:262004-04-09 12:26gja-guest
assigned_tonone2004-04-08 17:17hmg-guest
File Added65: sane-plustek.patch2004-04-06 13:05ellert-guest
Powered By FusionForge