New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unlink not working in specific piece of code, possibly an issue with threading or buffering? #6978
Comments
From eric.egdorf@mci.comCreated by eric.egdorf@mci.comI've got a program I'm writing that dumps text out to file, does "stuff" then $tdir = "/tmp"; $ddl = $tfile . ".DDL"; print "" . `ls -l $tfile` . ""; print "Deleting files\n"; print "\n" . `ls -l $tfile` . ""; # if unlink is uncommented it will fail, if left commented out ------------------------------------------------------------------------------------ Deleting files ------------------------------------------------------------------------------------ As you can see the files are still there. Executing code with the 2nd set of unlinks uncommented: Deleting files ------------------------------------------------------------------------------------ I've tried putting in several place holders and even threw in a sleep command Perl Info
|
From rick@bort.caOn Fri, Dec 12, 2003 at 10:06:08AM -0000, eric.egdorf@mci.com (via RT) wrote:
You might want to try a pwd here. The following files are not the same
I see files there but I doubt they are *the* files. Try changing -- |
From Robin.Barker@npl.co.ukCreated by eric.egdorf@mci.comI've got a program I'm writing that dumps text out to file, does "stuff" $tdir = "/tmp"; $ddl = $tfile . ".DDL"; print "" . `ls -l $tfile` . ""; print "Deleting files\n"; print "\n" . `ls -l $tfile` . ""; # if unlink is uncommented it will fail, if left commented out ------------------------------------------------------------------------ Deleting files ------------------------------------------------------------------------ As you can see the files are still there. Executing code with the 2nd set of unlinks uncommented: Deleting files ------------------------------------------------------------------------ I've tried putting in several place holders and even threw in a sleep Perl Info
|
From eric.egdorf@mci.comCreated by eric.egdorf@mci.comI've got a program I'm writing that dumps text out to file, does "stuff" $tdir = "/tmp"; $ddl = $tfile . ".DDL"; print "" . `ls -l $tfile` . ""; print "Deleting files\n"; print "\n" . `ls -l $tfile` . ""; # if unlink is uncommented it will fail, if left commented out ------------------------------------------------------------------------ Deleting files ------------------------------------------------------------------------ As you can see the files are still there. Executing code with the 2nd set of unlinks uncommented: Deleting files ------------------------------------------------------------------------ I've tried putting in several place holders and even threw in a sleep Perl Info
|
From eric.egdorf@mci.comGot emails from both of you so decided to copy both... Here is the output with the ls -li, the inode numbers matched. program output: 250746 -rw-rw-rw- 1 redbrick users 364 2003-12-12 10:32 /tmp/storage_6476.tmp Deleting files ls command output: 250746 -rw-rw-rw- 1 redbrick users 451 2003-12-12 10:32 storage_6476.tmp Eric Egdorf -----Original Message----- On Fri, Dec 12, 2003 at 10:06:08AM -0000, eric.egdorf@mci.com (via RT) wrote:
You might want to try a pwd here. The following files are not the same
I see files there but I doubt they are *the* files. Try changing -- |
From guest@guest.guest.xxxxxxxxIsolated the problem, sort of. It appears the problem is that the I saw that the notes for 8.1 and 8.2 mention memory leak issues so I'm Code: #------------------------------------------------------------------------- # read through the table list -- wherefor for and not foreach? $table = $tables[$tcnt][0] ; # generate create segment statements? $SELECT = "select name, type, length, precision, scale, start, "; $FROM = "from rbw_columns "; $WHERE = "where tname = '" . uc($table) . "' "; $GROUP = ""; $ORDER = "order by seq "; if ( $DEBUG >= 3 ) # tfile has different value then one assigned above export to '$tfile' if ( $DEBUG >= 3 ) $ret = `$cmd`; if ( $ret !~ "EXPORT" ) open(COLS, @clmn = <COLS>; $cnt = 0; $c_cnt = 0; # number of coumments print "create table $table\n(\n"; @c_com = (); foreach $c_data ( @clmn ) @column = split /\|/, $c_data; # print "c_data:\n$c_data\n"; $cname = $column[0]; if ( $comment ne "" ) if ( $pkseq ne "" ) $col .= "$cname $type "; if ( $type eq "INTEGER" ) if ( $fillfactor ne "" ) if ( $nulls eq "N" ) if ( $uniq eq "Y" ) if ( $default ne "" ) if ( $cnt < $ncols ) { $col .= ",\n"; } print " $col"; $cnt++; # additional statements # I thought the new functions might be the problem so genFKConstraints($table); print "\n);\n\n"; if ( $maxsegs ne "" ) if ( $maxrows ne "" ) print ";\n"; if ( $tcom ne "" ) foreach $ccmt (@c_com) # tfile has different value then values assigned above $ddl = $tfile . ".DDL"; print "Deleting files\n"; unlink print "Deleted files\n"; print "" . `ls -li $tfile` . ""; close(COLS); if ( $DEBUG >= 4 ) |
From eric.egdorf@mci.comMy code file is about 1000 lines. Should I post it or would anybody like me to send it to them as an attachment? Eric Egdorf |
From nick@ing-simmons.netEric Egdorf <Eric.Egdorf@mci.com> writes:
Sizes are changing - is something else writing them?
|
From @pjcjOn Fri, Dec 12, 2003 at 10:36:06AM -0700, Eric Egdorf wrote:
If Nick's observation doesn't lead anywhere useful please try to reduce Hopefully you would be able to reduce the test to such a size that there -- |
From guest@guest.guest.xxxxxxxxAs per my last post and email, the problem appears to be a memory leak. I am using the same variable name in each function so my assumption is |
From eric.egdorf@mci.comEric Egdorf -----Original Message----- On Fri, Dec 12, 2003 at 10:36:06AM -0700, Eric Egdorf wrote:
If Nick's observation doesn't lead anywhere useful please try to reduce Hopefully you would be able to reduce the test to such a size that there -- |
From eric.egdorf@mci.comHit the wrong button, <sigh>. As per my last post and email, the problem appears to be a memory leak. I am assigning a variable and using it a few lines later, the value getting used is not what I am assigning and there are no othere references to the variable between when I assign it and when I use it. When I reported the bug I was thrown off the track by the value in the variable because the file name is only used in one function. The old file name got moved into the variable even though I assigned it a different value. The problem is not with unlink, the problem is the variable getting changed without any assignment. Eric Egdorf -----Original Message----- On Fri, Dec 12, 2003 at 10:36:06AM -0700, Eric Egdorf wrote:
If Nick's observation doesn't lead anywhere useful please try to reduce Hopefully you would be able to reduce the test to such a size that there -- |
From @dcollinsnNever got a minimal test case, not enough information to determine if this is resolved or user error, but unable to reproduce. Closing. |
From [Unknown Contact. See original ticket]Never got a minimal test case, not enough information to determine if this is resolved or user error, but unable to reproduce. Closing. |
@dcollinsn - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#24645 (status was 'rejected')
Searchable as RT24645$
The text was updated successfully, but these errors were encountered: