garu / Clone

recursively copy Perl datatypes
7 stars 10 forks source link

Cloning a DBI database handle results in segfault #27

Open HaraldJoerg opened 5 years ago

HaraldJoerg commented 5 years ago

This may be related to #14 and #17, as all circle around the topic of "don't clone database handles". The attached script segfaults on Linux (Debian stretch, Perl 5.28). I don't mind if Clone::clone dies if it detects a database handle, but it should somehow safeguard against segfaults. dbhclone.txt

atoomic commented 5 years ago

I agree with you if this is unsupported we should try to detect and croak when someone clones a dbh... this would protects against such errors in the future

garu commented 5 years ago

I agree, but I think Cloning database handles should be supported if at all possible. The original author considered this a bug, so I think we should too, unless it's really not something anyone should do.

atoomic commented 5 years ago

Having on our roadmap a plan to support forking Database Handlers, does not block us to detect such a clone and trap this with an error like Forking DBH is currently not supported and prevent a SegFault.

Of course if we can come with a patch to support it in a short time, than that warning message becomes unnecessary.