[fossil-users] "inflate fast" error on compile

2016-10-05 Thread Dan Raymond
Hi All,

I am having trouble compiling Fossil on Windows with MinGW

all goes smoothly until the very end when I get this as the last lines of
compile:

src/../zlib/libz.a(inflate.o):inflate.c:(.text+0x1f07): undefined reference
to `inflate_fast'
collect2.exe: error: ld returned 1 exit status
make: *** [fossil.exe] Error 1

Any ideas as to how to sort this out please?

Dan
Level 19 Waterfront Place, 1 Eagle Street Brisbane Qld 4000 Australia
Mail:   PO Box 7815 Waterfront Place, Brisbane 4001
Tel:+61 733 600 255
Mob:  +61 400 551 920
Fax:   +61 733 600 222
Web:  http://ecourban.com.au
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] visual studio solution and project file for fossil

2016-10-05 Thread Ross Berteig

On 10/5/2016 3:27 PM, Richard Hipp wrote:

On 10/5/16, Ross Berteig  wrote:

Note that building for 64-bit needs something trickier than just
following that recipe from a 64-bit VisualStudio prompt.

Really?  Because just typing "nmake /f makefile.msc" from a 64-bit
VisualStudio prompt works fine for me on Windows10 with VS2012.

I have VS2010 installed here. It is possible I was fooled by not having 
a clean enough workspace.


Certainly, having zlib already built by a previous 32-bit compile wasn't 
helping. I tried to work around that by also setting 
FOSSIL_ENABLE_MINIZ=1 which did allow a clean compile and link. The 
resulting fossil.exe ran, at least fossil version -v worked. I did not 
run the test suite.


But handing it to DEPENDS.EXE to see what DLLs it was really linked 
against showed a mix of 32-bit and 64-bit DLLs. That might be a red 
herring, and does seem odd to me given that the program does run at all.


I certainly can try running the test suite over that fossil, and see 
what happens. I'll try that later tonight and report back.


--
Ross Berteig   r...@cheshireeng.com
Cheshire Engineering Corp.   http://www.CheshireEng.com/
+1 626 303 1602

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] visual studio solution and project file for fossil

2016-10-05 Thread Richard Hipp
On 10/5/16, Ross Berteig  wrote:
>
> Note that building for 64-bit needs something trickier than just
> following that recipe from a 64-bit VisualStudio prompt.

Really?  Because just typing "nmake /f makefile.msc" from a 64-bit
VisualStudio prompt works fine for me on Windows10 with VS2012.

-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] visual studio solution and project file for fossil

2016-10-05 Thread Ross Berteig


On 10/5/2016 11:30 AM, Richard Hipp wrote:

On 10/5/16, arnoldemu  wrote:

I see that fossil can be built with a batch file "buildmsvc.bat" which uses
the command-line visual studio compiler. It uses some kind of custom build
where the headers which are needed are added to the files and output into a
separate directory. I don't really understand fully how this works and is a
guess from what I have seen so far.

To build using msvc from the command-line:

 cd win
 nmake /f makefile.msc


To get a debug build, just add DEBUG=1 to the nmake command. You might 
want that to be a clean build the first time so that you get everything 
built for debugging. You should be able to just use the resulting EXE 
and PDB files in Visual Studio.


In a 32-bit VisualStudio command prompt where all the compiler tools are 
available:


C:>cd win
C:>nmake /f makefile.msc DEBUG=1

Note that building for 64-bit needs something trickier than just 
following that recipe from a 64-bit VisualStudio prompt. Fossil will 
build, but the resulting executable seems to be linked to a mix of 
64-bit and 32-bit DLLs, and that can't possibly be the right answer.


Personally, I've never built fossil other than 32-bit on Windows (and 
usually using GCC via MinGW) and I've never had any issues with it not 
being a 64-bit build.


There are other configuration options you can choose in a similar way, 
see the start of Makefile.msc for the complete list.


--
Ross Berteig   r...@cheshireeng.com
Cheshire Engineering Corp.   http://www.CheshireEng.com/
+1 626 303 1602

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] visual studio solution and project file for fossil

2016-10-05 Thread Steven Gawroriski
On Wed, 5 Oct 2016 15:40:46 -0400
Steven Gawroriski  wrote:

> Hello,
> 
> On Wed, 5 Oct 2016 20:13:36 +0200 (CEST)
> arnoldemu  wrote:
> 
> > I want to make a solution for fossil so I can build fossil under
> > visual studio itself from the IDE itself. I can then use the IDE's
> > debugger. I tried to add all the source files from inside the src
> > directory but that didn't work. So I then ran the batch file, waited
> > for it to build and then used the source files from the msvcbld and
> > that didn't seem to work either.
> > 
> > So I have failed so far and wondered if anyone has made a solution
> > and if they did, how did they do it?
> 
> On Wed, 5 Oct 2016 14:30:34 -0400
> Richard Hipp  wrote:
> 
> > Fossil uses a great deal of generated code.  IDEs such as Visual
> > Studio, on the other hand, are usually built around the assumption
> > that all code is hand-written.  Generated code is a more powerful
> > concept, and ultimately makes development easier and less error
> > prone. But since IDEs do not support it well, I think you will have
> > difficulty putting together a "solution" for Fossil.
> 
> Although it has been awhile since I last touched MSVC (I use Linux
> now), what you would want is to setup a custom build rule in the MSVC
> solution. Basically you can add an input source file which when ran
> through the rule produces the resulting source code or alternatively
> translates the source and then compiles it. The only issue would be
> that you may have to have a set of virtual files and dependencies for
> these autogenerated files if you do not want to do complete rebuilds
> each time you want to compile.
> 
> Depending on the maintainability requirements of the MSVC solution,
> one that would require minimal maintaining is to just have a complete
> build every time (always out of date), source code files that all use
> a build rule that effectively does nothing, and a custom build step
> which basically calls the batch file that exists at the root of the
> Fossil repository. With a base template and a script (such as a POSIX
> shell script), if a new source code file is added the script could be
> ran which generates a new MSVC solution as required (and commit that
> to the repository).

Or instead of doing all of that, you could just have the project use
the makefile that exists in `win/` and basically not worry about
everything else. You would still need to specify the output executable
name I believe (needed for debugging) along with arguments for
execution and the working directory.

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] ./src/delta.c:231: checksum: Assertion failed

2016-10-05 Thread Andy Bradford
Thus said Warren Young on Wed, 05 Oct 2016 09:04:57 -0600:

> That's  a nice  bit  of detective  work, Andy!  I  can't imagine  what
> possessed you to keep pursuing it for 8 months, but thank you. :)

Haha, well, it was a bit less glamorous than 8 months of investigations.
:-) I was trying  to get the stash-fixes branch ready  to merge to trunk
and the first thing I did was  create an empty file, rename it, and then
attempt to stash it. I got the  assert and remembered that we hadn't yet
solved the problem, primarily because  nobody was ever able to reproduce
it, so I dug up the old thread.

Thanks,

Andy
-- 
TAI64 timestamp: 400057f557db


___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] visual studio solution and project file for fossil

2016-10-05 Thread Steven Gawroriski
Hello,

On Wed, 5 Oct 2016 20:13:36 +0200 (CEST)
arnoldemu  wrote:

> I want to make a solution for fossil so I can build fossil under
> visual studio itself from the IDE itself. I can then use the IDE's
> debugger. I tried to add all the source files from inside the src
> directory but that didn't work. So I then ran the batch file, waited
> for it to build and then used the source files from the msvcbld and
> that didn't seem to work either.
> 
> So I have failed so far and wondered if anyone has made a solution
> and if they did, how did they do it?

On Wed, 5 Oct 2016 14:30:34 -0400
Richard Hipp  wrote:

> Fossil uses a great deal of generated code.  IDEs such as Visual
> Studio, on the other hand, are usually built around the assumption
> that all code is hand-written.  Generated code is a more powerful
> concept, and ultimately makes development easier and less error prone.
> But since IDEs do not support it well, I think you will have
> difficulty putting together a "solution" for Fossil.

Although it has been awhile since I last touched MSVC (I use Linux
now), what you would want is to setup a custom build rule in the MSVC
solution. Basically you can add an input source file which when ran
through the rule produces the resulting source code or alternatively
translates the source and then compiles it. The only issue would be
that you may have to have a set of virtual files and dependencies for
these autogenerated files if you do not want to do complete rebuilds
each time you want to compile.

Depending on the maintainability requirements of the MSVC solution, one
that would require minimal maintaining is to just have a complete build
every time (always out of date), source code files that all use a build
rule that effectively does nothing, and a custom build step which
basically calls the batch file that exists at the root of the Fossil
repository. With a base template and a script (such as a POSIX shell
script), if a new source code file is added the script could be ran
which generates a new MSVC solution as required (and commit that to the
repository).

___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] visual studio solution and project file for fossil

2016-10-05 Thread Richard Hipp
On 10/5/16, arnoldemu  wrote:
>
> I see that fossil can be built with a batch file "buildmsvc.bat" which uses
> the command-line visual studio compiler. It uses some kind of custom build
> where the headers which are needed are added to the files and output into a
> separate directory. I don't really understand fully how this works and is a
> guess from what I have seen so far.

To build using msvc from the command-line:

cd win
nmake /f makefile.msc

A description of the build process is found in
https://www.fossil-scm.org/fossil/doc/trunk/www/makefile.wiki

Fossil uses a great deal of generated code.  IDEs such as Visual
Studio, on the other hand, are usually built around the assumption
that all code is hand-written.  Generated code is a more powerful
concept, and ultimately makes development easier and less error prone.
But since IDEs do not support it well, I think you will have
difficulty putting together a "solution" for Fossil.

You can run Fossil in the visual studio debugger.  Joe showed me how
to do that once.  I could probably fumble my way through doing it
again, but I'm not comfortable trying to describe the process.  But
basically, you build the fossil.exe using nmake, then you fire up
Visual Studio to single-step through the code.  This gives you the
best of both worlds.  You can use powerful generated code techniques
from the command-line to construct the executable.  Then you can use
your nice GUI interface for single-stepping through the code to figure
out why it isn't working.

>
> I want to make a solution for fossil so I can build fossil under visual
> studio itself from the IDE itself. I can then use the IDE's debugger. I
> tried to add all the source files from inside the src directory but that
> didn't work. So I then ran the batch file, waited for it to build and then
> used the source files from the msvcbld and that didn't seem to work either.
>
> So I have failed so far and wondered if anyone has made a solution and if
> they did, how did they do it?
>
> The second question was:
> - Is there a way I can modify (or pass a parameter) to the buildmsvc.bat to
> make a "debug" build without the compiler doing optimisations and with it
> generating a debug pdb. I could also debug fossil from within visual studio
> this way.
>
> Thanks
>
> Kevin
>
>
> ___
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>


-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] visual studio solution and project file for fossil

2016-10-05 Thread arnoldemu

> Fossil's primary use is to keep track of changes in your files, it is not a 
> build system perse. If you want to use Visual Studio, why not use something 
> like CMake: 

Hi Arjun,

Thankyou for your reply. Sorry but after reading back my question I don't think 
I worded it well and I didn't make it clear about what I wanted.

I want to build fossil itself because I want to patch it and hopefully submit 
my patches for review.

I see that fossil can be built with a batch file "buildmsvc.bat" which uses the 
command-line visual studio compiler. It uses some kind of custom build where 
the headers which are needed are added to the files and output into a separate 
directory. I don't really understand fully how this works and is a guess from 
what I have seen so far.

I want to make a solution for fossil so I can build fossil under visual studio 
itself from the IDE itself. I can then use the IDE's debugger. I tried to add 
all the source files from inside the src directory but that didn't work. So I 
then ran the batch file, waited for it to build and then used the source files 
from the msvcbld and that didn't seem to work either.

So I have failed so far and wondered if anyone has made a solution and if they 
did, how did they do it?

The second question was:
- Is there a way I can modify (or pass a parameter) to the buildmsvc.bat to 
make a "debug" build without the compiler doing optimisations and with it 
generating a debug pdb. I could also debug fossil from within visual studio 
this way.

Thanks

Kevin


___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Eduardo Morras
On Wed, 5 Oct 2016 09:37:23 -0600
Warren Young  wrote:

> Windows actually has a whole pile of limitations on file names, all
> of which you could warn about in Fossil under the same argument:

Some years ago in Sqlite mailing list (2007?) there was a problem
naming Sqlite DataBases with .sdb extension under Windows, system makes
a backup of the db file each time it's modified . 

There are lots of restricted extensions on Windows too, not only on the
name.

---   ---
Eduardo Morras 
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Scott Robison
On Wed, Oct 5, 2016 at 10:03 AM, Konstantin Khomoutov <
flatw...@users.sourceforge.net> wrote:

> On Wed, 5 Oct 2016 09:37:23 -0600
> Warren Young  wrote:
>
> [...]
> > 2. Contrast almost every Unix system, where the only illegal
> > character in a file name is the forward slash.
>
> ...and NUL, I beleive.
>

Not to be confused with the DOS/Windows NUL device. :)

-- 
Scott Robison
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Konstantin Khomoutov
On Wed, 5 Oct 2016 09:37:23 -0600
Warren Young  wrote:

[...]
> 2. Contrast almost every Unix system, where the only illegal
> character in a file name is the forward slash.

...and NUL, I beleive.

[...]
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread ApexVitality
Unsubscribe me from this list or any other lists I didn't ask to join
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Warren Young
On Oct 5, 2016, at 8:59 AM, Richard Hipp  wrote:
> 
> On 10/5/16, Warren Young  wrote:
>> 
>> If your repository has such file names in it, working around the
>> Windows limitation in Fossil just boots the problem a few squares down the
>> sidewalk, where it will be stumbled upon shortly by some other tool.
> 
> For this reason, the current fix is simply to output a more helpful
> error message that tries to explain the situation.
> 
> Probably we also need to also fix Fossil so that it doesn't give up
> and die when it encounters an error like this but instead at least
> tried to check out all the other files.  Perhaps there should also be
> warnings when one does "fossil add" or "fossil mv" to create a
> disallowed filename on unix - a warning to say that this will work
> fine on unix but will fail when you move the change to windows.

I’m okay with warnings, but that’s as far as it should go.  I don’t want to see 
Fossil adopting least-common-denominator policies that prevent those of us who 
have repos that never touch Windows from being limited by Windows.

(I currently use a program on Mac OS X that enforces such restrictions, and 
it’s seriously annoying.)

Windows actually has a whole pile of limitations on file names, all of which 
you could warn about in Fossil under the same argument:

- You can’t have a dot at the end of a file name. [1]

- There are a whole raft of illegal characters: < > : " / \ | ? and * plus 
ASCII 0 thru 31  [2]

- NTFS and FAT are case-insensitive in everyday use.  Therefore, Fossil 
arguably should warn on any operation that would create a collision on 
case-insensitive file systems. [3]



——

Asides:

1. This is an ancient limitation inherited from DOS and FAT, where a dot at the 
end meant you wanted a file with no extension, which wasn’t legal until Windows 
NT came around.  CMD.EXE and Explorer seem to just eat the dot when you try to 
create such a file.  Cygwin can create an “a.” file, but then Notepad barfs if 
you try to open it, thinking you meant “a.txt” and Explorer fails to delete it, 
claiming it couldn’t find the file.  Such are the problems of attempting to 
support files with a dot at the end on Windows.

2. Contrast almost every Unix system, where the only illegal character in a 
file name is the forward slash.  Mac OS X is the only common exception, also 
disallowing colon because it was the path separator in Classic Mac OS, which 
carries over into OS X today via HFS+, and historically via Rosetta.  I expect 
that limitation is going away with APFS, but that’s just speculation.

3. Also applies to HFS+ on Mac OS X.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] ./src/delta.c:231: checksum: Assertion failed

2016-10-05 Thread Warren Young
On Oct 5, 2016, at 12:59 AM, Andy Bradford  wrote:
> 
> I propose that blob_delta_create  should use blob_materialize instead of
> blob_buffer here:
> 
> http://www.fossil-scm.org/index.html/info/75ddc3687acbdb32

That’s a nice bit of detective work, Andy!  I can’t imagine what possessed you 
to keep pursuing it for 8 months, but thank you. :)
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Richard Hipp
On 10/5/16, Warren Young  wrote:
>
> Agreed.  If your repository has such file names in it, working around the
> Windows limitation in Fossil just boots the problem a few squares down the
> sidewalk, where it will be stumbled upon shortly by some other tool.

For this reason, the current fix is simply to output a more helpful
error message that tries to explain the situation.

Probably we also need to also fix Fossil so that it doesn't give up
and die when it encounters an error like this but instead at least
tried to check out all the other files.  Perhaps there should also be
warnings when one does "fossil add" or "fossil mv" to create a
disallowed filename on unix - a warning to say that this will work
fine on unix but will fail when you move the change to windows.


>
> That said, if y’all decide to support AUX and such on Windows anyway, I
> wrote some code to do this recently, just to prove a point on
> unix.stackexchange.com. :)
>
>   http://pastebin.com/rTs88KmD
>
> The code is written for the NUL case, but it’s the same for AUX, CON, etc.
>
> If someone wants to use that as a basis for a Fossil patch, the code is
> currently licensed under cc-by-sa 3.0.  That may be liberal enough to
> include it in Fossil as-is.
> ___
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>


-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Warren Young
On Oct 4, 2016, at 2:52 PM, Ross Berteig  wrote:
> 
> On 10/4/2016 12:40 PM, Andy Bradford wrote:
>> Thus said Richard Hipp on Tue, 04 Oct 2016 12:15:58 -0400:
>>> Does anybody know of a reasonable work-around?
>> What  do other  VCS do?
> 
> IMHO, using namespace tricks to create the files or folders with reserved 
> names will only result in additional mysterious failures and pain for Windows 
> users. No build systems or compilers will be using those tricks, and even 
> deleting the files later becomes a problem for the user.

Agreed.  If your repository has such file names in it, working around the 
Windows limitation in Fossil just boots the problem a few squares down the 
sidewalk, where it will be stumbled upon shortly by some other tool.

That said, if y’all decide to support AUX and such on Windows anyway, I wrote 
some code to do this recently, just to prove a point on unix.stackexchange.com. 
:)

  http://pastebin.com/rTs88KmD

The code is written for the NUL case, but it’s the same for AUX, CON, etc.

If someone wants to use that as a basis for a Fossil patch, the code is 
currently licensed under cc-by-sa 3.0.  That may be liberal enough to include 
it in Fossil as-is.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] visual studio solution and project file for fossil

2016-10-05 Thread Arjen Markus
Fossil's primary use is to keep track of changes in your files, it is not a 
build system perse. If you want to use Visual Studio, why not use something 
like CMake: that can generate VS files from the description of your programs 
(CMakeLists.txt files and the like or plain Makefiles if you prefer them). 
These CMake files can in turn be maintained with Fossil, just as source code.



Regards,



Arjen



From: fossil-users [mailto:fossil-users-boun...@lists.fossil-scm.org] On Behalf 
Of arnoldemu
Sent: Wednesday, October 05, 2016 8:59 AM
To: fossil-users@lists.fossil-scm.org
Subject: [fossil-users] visual studio solution and project file for fossil

Hi

I am not familiar enough with the fossil build system so I hope somebody can 
answer these questions.

Is there a way to generate a visual studio solution and project file from the 
fossil source which I can then load up in visual studio 2015 community edition?

Or an alternative: is there a way to generate a debug build with pdbs which I 
can debug through visual studio?

I used to using visual studio for debugging and it would help me to finish my 
gmerge patch.

Thank you

Kevin


DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited. 
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] unversioned files - converting files from versioned to unversioned and limiting the number of versions

2016-10-05 Thread arnoldemu
Hi,

I have some binary files in my repository which are currently versioned. I see 
there is a new unversioned file feature and I would like to convert them to 
unversioned. 

Is there a way to "convert" a file from versioned to unversioned? 

In Perforce there is a way to limit the number of versions (I can set this 
through P4V), is there anything similar in fossil? Is there a way to define and 
keep the last 'n' revisions?

Thank you

Kevin
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] ./src/delta.c:231: checksum: Assertion failed

2016-10-05 Thread Andy Bradford
Thus said Richard Hipp on Tue, 09 Feb 2016 07:39:57 -0500:

> The  input to  checksum() should  normally be  a pointer  to a  buffer
> obtained  from malloc().  And  such buffers  should  always be  8-byte
> aligned (or  4-byte aligned on Windows).  So I'm not sure  how this is
> happening.  There  must  be  some path  somewhere  in  Fossil  whereby
> delta_create()  or delta_apply()  is called  with a  pointer into  the
> middle of an allocated buffer, rather  than a pointer to the beginning
> of the buffer.

In  some cases,  the input  to checksum(),  specifically, zIn  (which is
actually zOut in the caller  delta_create), may not actually be obtained
from malloc(). I am able to reproduce this particular assertion with the
following:

$ touch file
$ fossil add file
ADDED  file
$ fossil commit -m added
New_Version: 5c966f6fe56d2efd262865f0a504fd102bb0c078
$ fossil mv file other
RENAME file other
$ mv file other
$ fossil stash save -m renamed
assertion "(z - (const unsigned char*)0)%4==0" failed: file "./src/delta.c", 
line 231, function "checksum"
Abort trap (core dumped) 

Given that blob_zero initializes pBlob->aData here:

http://www.fossil-scm.org/index.html/artifact/831a63c8c61dbfdb5fe629a473cd7b01104478fc?txt=1=262+266

Then, stash tries to read a file that is empty:

http://www.fossil-scm.org/index.html/artifact/ced32acae9b125f723c6473f30cdfdf8b530dc37?txt=1=123+126

In this  case, pBlob->aData has  not been allocated by  malloc() because
the file was  empty (file size of  0 so the blob was  never altered from
its initial  state). And sure enough,  the address of memory  for zIn (a
buffer pointing to pBlob->aData) on one invocation on my system:

Breakpoint 4, checksum (zIn=0x36127dfb "", N=0) at delta.c:226
226 static unsigned int checksum(const char *zIn, size_t N){

$ echo 'puts [expr {0x36127dfb % 4}]' | tclsh
3

Which is why the assertion fails.

I propose that blob_delta_create  should use blob_materialize instead of
blob_buffer here:

http://www.fossil-scm.org/index.html/info/75ddc3687acbdb32

Thanks,

Andy
-- 
TAI64 timestamp: 400057f4a4f8


___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] visual studio solution and project file for fossil

2016-10-05 Thread arnoldemu
Hi

I am not familiar enough with the fossil build system so I hope somebody can 
answer these questions.

Is there a way to generate a visual studio solution and project file from the 
fossil source which I can then load up in visual studio 2015 community edition? 

Or an alternative: is there a way to generate a debug build with pdbs which I 
can debug through visual studio?

I used to using visual studio for debugging and it would help me to finish my 
gmerge patch.

Thank you

Kevin



___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users