vngas10ucozru via rt veyjhbyfbuaeanjperlorg new ticket created vngas10ucozru please include string perl 46207 subject line future correspondence issue bug report perl crobsuchnet generated help perlbug 135 running perl v588 change 30946 patch 30633 perlio_exportfile perlio_releasefile manage fd reference counts correctly breaks compatibility perl modules leading file descriptor leakage gd235 module contains functions like gdimagenewfromjpegfile truecolor take file descriptor first argument following code produces many open files error appear 588stable jpgfile named 1jpg test work use gd foreach12000 openf1jpg die n imgdimagenewfromjpegf1 closef close close file experiments held newfromjpeg realized follows define gdimagecreatefromjpegx gdimagecreatefromjpegperlio_findfilex gdimage gd_newfromjpegpacknamegdimage filehandle char packname inputstream filehandle prototype preinit ifdef start_my_cxt dmy_cxt int truecolor my_cxttruecolor_default else int truecolor truecolor_default endif code retval gdimagecreatefromjpegfilehandle items 2 truecolor intsvivst2 gd_chkimagefmtretval truecolor output retval according documentation perlapio perlio_findfile require call perlio_releasefile documentation says perlio_findfile call perlio_exportfile provided perlio object stdio layer present turn requires perlio_releasefile docs inconsistency gdxs changed produce code file tmp retvalgdimagecreatefromjpegtmpperlio_findfilefilehandle perlio_releasefilefilehandletmp another try made file tmp retvalgdimagecreatefromjpegtmpperlio_exportfilefilehandlenull perlio_releasefilefilehandletmp variants solved problem descriptor leakage introduced new one unknown errors passing file descriptors opened write mode extension gd module void gdjpegfileimagefilehandlequality1 gdimage image inputstream filehandle int quality prototype preinit file tmp code gdimagejpegimagetmpperlio_findfilefilehandlequality perlio_releasefilefilehandletmp line added trying avoid leaks trying call jpegfile newfromjpeg code openfimage1jpg imgjpegfilef closef produces empty file image2jpg perlio_releasefile absent file descriptor closed seems perlio_releasefile reopens file thereof truncates general found two ways solving problem without changing gd module 1 open files explicit stdio layer openfstdiofilename openfstdiofilename 2 revert patch 30633 flags categorycore severitycritical site configuration information perl v588 configured root tue oct 2 163917 msd 2007 summary perl5 revision 5 version 8 subversion 8 patch 31996 configuration platform osnamelinux osvers26229 archnamex86_64linux unamelinux localhost 26229 3 smp mon oct 1 041447 msd 2007 x86_64 gnulinux config_args hintrecommended useposixtrue d_sigactiondefine usethreadsundef use5005threadsundef useithreadsundef usemultiplicityundef useperliodefine d_sfioundef uselargefilesdefine usesocksundef use64bitintdefine use64bitalldefine uselongdoubleundef usemymallocy bincompat5005undef compiler cccc ccflags fnostrictaliasing pipe iusrlocalinclude d_largefile_source d_file_offset_bits64 optimizeo2 cppflagsfnostrictaliasing pipe iusrlocalinclude ccversion gccversion421 debian 4214 gccosandvers intsize4 longsize8 ptrsize8 doublesize8 byteorder12345678 d_longlongdefine longlongsize8 d_longdbldefine longdblsize16 ivtypelong ivsize8 nvtypedouble nvsize8 off_toff_t lseeksize8 alignbytes8 prototypedefine linker libraries ldcc ldflags lusrlocallib libpthusrlocallib lib usrlib lib64 usrlib64 libslnsl ldb ldl lm lcrypt lutil lc perllibslnsl ldl lm lcrypt lutil lc libcliblibc261so soso useshrplibtrue libperllibperlso gnulibc_version261 dynamic linking dlsrcdl_dlopenxs dlextso d_dlsymunundef ccdlflagswle wlrpathusrlibperl5588x86_64linuxcore cccdlflagsfpic lddlflagsshared o2 lusrlocallib locally applied patches maint30961 inc perl v588 usrlibperl5588x86_64linux usrlibperl5588 usrlibperl5site_perl588x86_64linux usrlibperl5site_perl588 environment perl v588 homeroot langru_rucp1251 language unset ld_library_path unset logdir unset pathusrlocalsbinusrlocalbinusrsbinusrbinsbinbinusrbinx11 perl_badlang unset shellbinbash tue 05 aug 2008 101756 0700 perl 46207 file descriptors leakage perlio leads program crash