From 98a60fec384a80f31830673d182a3c3ae9996fad Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 19 Oct 2010 17:07:21 +0000 Subject: [PATCH] Avoiding potential endless write pacifier loop. Introduced with rev 3432. --- libisoburn/trunk/ChangeLog | 8 ++++++-- libisoburn/trunk/xorriso/write_run.c | 17 ++++++++++++++++- libisoburn/trunk/xorriso/xorriso_timestamp.h | 2 +- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/libisoburn/trunk/ChangeLog b/libisoburn/trunk/ChangeLog index 17865b51..88802e15 100644 --- a/libisoburn/trunk/ChangeLog +++ b/libisoburn/trunk/ChangeLog @@ -1,11 +1,15 @@ SVN trunk (to become libisoburn-0.6.4.pl00.tar.gz) =============================================================================== -* Tests for version of libjte, new API call isoburn_libjte_req() -* New API calls isoburn_igopt_attach_jte() and isoburn_igopt_detach_jte() * New option -jigdo * New -as mkisofs options -jigdo-* and -md5-list as of genisoimage * New -as mkisofs options -checksum_algorithm_iso, -checksum_algorithm_template +* New bootspecs mips_path= and mipsel_path= for Debian MIPS releases +* New -as mkisofs options -mips-boot and -mipsel-boot +* New option -append_partition, -as mkisofs -append_partition +* New API call isoburn_libjte_req() +* New API calls isoburn_igopt_attach_jte() and isoburn_igopt_detach_jte() * New API call isoburn_igopt_set_tail_blocks() +* New API call isoburn_libjte_req() libisoburn-0.6.2.pl00.tar.gz Sat Sep 18 2010 diff --git a/libisoburn/trunk/xorriso/write_run.c b/libisoburn/trunk/xorriso/write_run.c index e9484914..5a6c342e 100644 --- a/libisoburn/trunk/xorriso/write_run.c +++ b/libisoburn/trunk/xorriso/write_run.c @@ -987,6 +987,8 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive, int flag) { int ret, size, free_bytes, i, aborting= 0, emul, buffer_fill= 50, last_sector; + int iso_wait_counter= 0, iso_cancel_limit= 5, iso_break_limit= 10; + int iso_cancelled= 0; struct burn_progress progress; char *status_text, date_text[80], *speed_unit, mem_text[8]; enum burn_drive_status drive_status; @@ -1030,8 +1032,21 @@ int Xorriso_pacifier_loop(struct XorrisO *xorriso, struct burn_drive *drive, */ if(image == NULL) break; - if(!iso_image_generator_is_running(image)) + if(!iso_image_generator_is_running(image)) { break; + } else if(iso_wait_counter > iso_cancel_limit && !iso_cancelled) { + + /* >>> cancel image burn source */; + + iso_cancelled= 1; + } else if(iso_wait_counter > iso_break_limit) { + + /* >>> This is dangerous. xorriso will free memory objects which might + be in use in the unstoppable libisofs thread. + */ + + break; + } } current_time= Sfile_microtime(0); if(drive_status == BURN_DRIVE_WRITING && progress.sectors > 0) { diff --git a/libisoburn/trunk/xorriso/xorriso_timestamp.h b/libisoburn/trunk/xorriso/xorriso_timestamp.h index 8eb32edb..47f8342f 100644 --- a/libisoburn/trunk/xorriso/xorriso_timestamp.h +++ b/libisoburn/trunk/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2010.10.19.104814" +#define Xorriso_timestamP "2010.10.19.170704"