Re: mkisofs multi-extent: more bugs

2009-01-09 Thread Andy Polyakov

 Interesting that you seem to have time to write this

This as communicate with growisofs user [and spend 7% of my post to 
point out misleading statement about cdrecord]? Well, how I dispose my 
time is my business, but if you have to know it's more important to me 
to communicate with dvd+rw-tools users. In other words yes, if I have 
few minutes I'd rather do that.


 but to not like to support
 mkisofs.

I don't understand... You have time ... to not like support mkisofs? 
Like have time to dislike doing something [without actually doing it]? 
No, I don't have time for such things either and don't do that. Or was 
it *do* not like [*to*] support mkisofs? Is it my job to support it? I 
spend several hours on bug hunting and this is thanks? Well, thanks for 
encouraging words!


 If you really have problems with mkisofs,

In a spirit of personal remarks I personally don't really have problems 
with mkisofs. I personally use home-patched version at my own 
discretion and don't really have problem with this.


 please make reports in a way that
 allows to fix them.

As I already said I'm *sorry* I can't do better, primarily because of 
lack of time. I'm ready to answer specific questions [but not about form 
of my report], if they don't take very much time [minus time I've spent 
reflecting over the remark and writing this], but I don't have time to 
reformulate my report[s]. A.



--
To UNSUBSCRIBE, email to cdwrite-requ...@other.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@other.debian.org



Re: mkisofs multi-extent: more bugs

2008-12-13 Thread Joerg Schilling
Andy Polyakov ap...@fy.chalmers.se wrote:

 As per http://lists.debian.org/cdwrite/2008/07/msg00078.html and 
 http://lists.debian.org/cdwrite/2008/07/msg00082.html 6 (six) a=40 
 multi.c bugs were reported:

 #1. end-less loop [or premature exit from it] in read_merging_directory;
 #2. incorrect merge of extents from previous session [generated by 
 alternative iso9660 formatter];
 #3. files or extents are omitted from multi-session recording due to 
 incorrect value returned by read_merging_directory;
 #4. failure to sort merged directory because of insufficient clean-up in 
 check_prev_session;
 #5. failure to sort merged directory if multi-extent files share same 
 iso9660 name;
 #6. apparent memory leak in check_prev_session;

 Of these 6 bugs two were fixed, #1 and #4, and one, #3, kind of fixed. 

If you found real problems, it would help a lot if we could discuss things in a 
way that allows us to forward.

The problem with your reports is that you mix several problems into one report
and that you only partially describe the problems in a way that allows to 
repeat 
them. You also send cumulated patches that include changes that itself introduce
bugs. This is why I could only fix about three problems from the list you send
half a year ago.

I am going to fix all problems that can be verified, but I am not going to
apply patches if I see a single problem in a provided patch. I am adopting 
patches only if they do not introduce obvious new problems and in case that some
basic tests pass with the new code.

As ISO-9660 allows to introduce many dirty tricks, many of them are unsupported
by mkisofs, so please reorder your list to let #2 appear last.

For the reasons mentioned above, I propose that you present each item in your 
list separately together with a description that allows to repeat the problem. 
If you have a fix that is specific to this problem, you are of course welcome to
present your fix.

Jörg

-- 
 EMail:jo...@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
   j...@cs.tu-berlin.de(uni)  
   joerg.schill...@fokus.fraunhofer.de (work) Blog: 
http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily


-- 
To UNSUBSCRIBE, email to cdwrite-requ...@other.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@other.debian.org



mkisofs multi-extent: more bugs

2008-12-12 Thread Andy Polyakov
As per http://lists.debian.org/cdwrite/2008/07/msg00078.html and 
http://lists.debian.org/cdwrite/2008/07/msg00082.html 6 (six) a=40 
multi.c bugs were reported:


#1. end-less loop [or premature exit from it] in read_merging_directory;
#2. incorrect merge of extents from previous session [generated by 
alternative iso9660 formatter];
#3. files or extents are omitted from multi-session recording due to 
incorrect value returned by read_merging_directory;
#4. failure to sort merged directory because of insufficient clean-up in 
check_prev_session;
#5. failure to sort merged directory if multi-extent files share same 
iso9660 name;

#6. apparent memory leak in check_prev_session;

Of these 6 bugs two were fixed, #1 and #4, and one, #3, kind of fixed. 
Kind of means that the problem as it was spelled in the problem report 
was resolved, but the thing is that affected procedure uses the return 
value itself and modification let it use wrong value. See below for 
further details. Rest of the problems were left without attention.


For reference, here is how to reproduce #5:

1. touch 5G; perl -e 'truncate(5G,5*1024*1024*1024)'
2. ./mkisofs -iso-level=3 -R 5G  a.iso
3. mv 5G 5g;
4. ./mkisofs -C X,Z -M a.iso -iso-level=3 -R 5g  /dev/null;

which results in fatal failure:

Using 5G000.;1 for  /5G (5g)
./mkisofs: Error: '/5G' and '5g' have the same ISO9660 name '5G.;1'.
./mkisofs: Error: '/5G' and '/5G' have the same Rock Ridge name '5G'.
./mkisofs: Unable to sort directory

Further bugs.

#7. './mkisofs -iso-level=3 -T 5g' is aborted with *** glibc detected 
*** double free or corruption. core file analysis reveals that fatal 
condition is raised in free called from sort_n_finish (there is only one 
free call in sort_n_finish). This is because dup_directory_entry does 
not duplicate -table member, and therefore the latter is bound to be 
double-freed.


#8. Once #7 is resolved './mkisofs -iso-level=3 -T 5g' completes, but 
TRANS.TBL comes out bloated with duplicating entries: one entry per 
recorded extent instead of one per whole multi-extent file.


#9. Once #8 is resolved, multi-extent names and names of last file[s] in 
current directory are found to be omitted from TRANS.TBL from 
multi-session recording with -T flag. Multi-extent names are omitted 
because only super directory entry is processed by 
read_merging_directory, and as it's marked with INHIBIT_ISO9660_ENTRY 
it's never nominated for TRANS.TBL. Single-extent files can be omitted 
from TRANS.TBL because of skewed fix for bug #3 (see above).


Attached patch relative to a53 addresses remaining and new problems.

In tree.c:
- vicinity of lines 573 and 713 - #8;
- vicinity of line 2403 - #7;

In multi.c:
- vicinity of line 805 - #3 and #9;
- vicinity of line 918 - #9;
- vicinity of line 943 - #3;
- vicinity of lines 1090 and 1148 - alternative solution to #2 based on 
copying of actual extents from previous session, not partial information 
from them, as well as #6;
- vicinity of lines 1357 and 1398 - #5, code was submitted earlier and 
its purpose is to maintain expected list order;

- vicinity of line 1869 - #6;

On related note to original report. tree.c also has inconsistencies 
between usage of USE_LARGEFILES and multi-extent support. A.


--- ./mkisofs/tree.c.orig	2008-09-11 16:01:02.0 +0200
+++ ./mkisofs/tree.c	2008-12-11 10:56:10.0 +0100
@@ -573,6 +573,12 @@
 #endif	/* APPLE_HYB */
 			if (s_entry-de_flags  INHIBIT_ISO9660_ENTRY)
 continue;
+			/*
+			 * In every ISO_MULTIEXTENT chain last entry
+			 * is the only one without the flag.
+			 */
+			if (s_entry-isorec.flags[0]  ISO_MULTIEXTENT)
+continue;
 			if (s_entry-table) {
 /*
  * Max namelen, a space before and a space
@@ -713,6 +719,12 @@
 			if (s_entry-de_flags  INHIBIT_ISO9660_ENTRY)
 continue;
 			/*
+			 * In every ISO_MULTIEXTENT chain last entry
+			 * is the only one without the flag.
+			 */
+			if (s_entry-isorec.flags[0]  ISO_MULTIEXTENT)
+continue;
+			/*
 			 * Warning: we cannot use the return value of sprintf
 			 * because old BSD based sprintf() implementations
 			 * will return a pointer to the result instead of a
@@ -2403,6 +2415,8 @@
 		s_entry1-name = e_strdup(s_entry-name);
 	if (s_entry-whole_name)
 		s_entry1-whole_name = e_strdup(s_entry-whole_name);
+	if (s_entry-table)
+		s_entry1-table = e_strdup(s_entry-table);
 #ifdef	APPLE_HYB
 	/*
 	 * If we also duplicate s_entry-hfs_ent, we would need to change
--- ./mkisofs/multi.c.orig	2008-08-28 23:06:34.0 +0200
+++ ./mkisofs/multi.c	2008-12-11 11:02:06.0 +0100
@@ -76,7 +76,7 @@
 LOCAL	void	free_directory_entry __PR((struct directory_entry * dirp));
 LOCAL	int	iso_dir_ents	__PR((struct directory_entry *de));
 LOCAL	void	copy_mult_extent __PR((struct directory_entry *se1,
-	struct directory_entry *se2));
+	struct directory_entry *se2[]));
 LOCAL	void	merge_remaining_entries __PR((struct directory *,
 	struct directory_entry **, int));
 
@@ -805,6