[fossil-users] Side-by-side diff broken in version 1.22 on Windows?

3 views
Skip to first unread message

Jos Groot Lipman

unread,
Mar 18, 2012, 6:20:03 PM3/18/12
to Fossil SCM user's discussion
Today I downloaded the latest Fossil version 1.22 from the website and started using it on my Windows Vista.
 
When I start 'fossil ui' and ask Fossil for a 'diff' of a file Fossil crashes and Windows show a 'Fossil.exe has stopped working'
 
It is not just my own repository: it also happens when I start 'fossil ui' on a recent clone of the Fossil source repository: in http://127.0.0.1:8080/info/7b89c7b5b3 I click on the diff of src/json_dir.c and Fossil crashes.
 
D:\Software\Fossil>fossil122.exe version
This is fossil version 1.22 [f7e215bcac] 2012-03-17 17:53:25 UTC
 
With a fossil121.exe I get the (less fancy) side-by-side diffs without any problem.
 
Before I dig into it more deeply: can anyone reproduce this behaviour?
 
Jos Groot Lipman

Richard Hipp

unread,
Mar 18, 2012, 6:38:23 PM3/18/12
to Fossil SCM user's discussion

Works fine for me here and at http://www.fossil-scm.org/fossil/info/7b89c7b5b3
 
 
Jos Groot Lipman

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




--
D. Richard Hipp
d...@sqlite.org

Benoit Mortgat

unread,
Mar 19, 2012, 4:34:27 AM3/19/12
to Fossil SCM user's discussion
Same problem here.

Fossil 1.22 runs as a service on a Windows 7 system. When asking for a
diff of a single file, fossil sometimes does not respond. However, when
asking for a diff for the whole set of files in a checkout, it does not.

This does not happen every time. For example, on a clone of the SQLite
official repository, running “fossil http”, there is no problem with
the following stdin input:

GET /fdiff?v1=549b1a2e5e0ed1e1&v2=c7d888830f168a9b HTTP/1.1
Host: 127.0.0.1:8081

Whereas there is a problem with

GET /fdiff?v1=3a441671f35569df&v2=51acd5477f7c9232 HTTP/1.1
Host: 127.0.0.1:8081

Windows reports f.exe has stopped working, but when it has been run as
“fossil ui”, the executable still runs and will serve correctly
subsequent HTTP incoming requests.

If you tell us what compilers, flags, etc. are used to build the
official releases of fossil for Windows I can take some time to find
at which line in which source file the error happens.


On Sun, Mar 18, 2012 at 23:38, Richard Hipp <d...@sqlite.org> wrote:
>
>
> On Sun, Mar 18, 2012 at 6:20 PM, Jos Groot Lipman <dont...@home.nl> wrote:
>>
>> Today I downloaded the latest Fossil version 1.22 from the website and
>> started using it on my Windows Vista.
>>
>> When I start 'fossil ui' and ask Fossil for a 'diff' of a file Fossil
>> crashes and Windows show a 'Fossil.exe has stopped working'
>>

--
Benoit Mortgat

Jos Groot Lipman

unread,
Mar 19, 2012, 6:08:53 AM3/19/12
to Fossil SCM user's discussion
I compiled with Visual Studio 2005 and the crash occurs at line 404 in
diff.c
int x = strlen(p->zStart);
It fails (access violation) because p->zStart is 0x00000050

This happened when I compiled with /Zi (include debug info)
Debugging is still difficult because of /O2 (optimize for speed) so I tried
with /Od (no optimizing)
However, now the problem is gone. I hate that.

More info tonight....

Benoit Mortgat

unread,
Mar 19, 2012, 6:10:45 AM3/19/12
to Fossil SCM user's discussion
Compiling with mingw, fossil receives SIGSEGV in in sbsWriteText :

int x = strlen(p->zStart);

Printing zStart in gdb shows : $2 = 0x7 <Address 0x7 out of bounds>.

In the caller, we have:

s.zStart = "<span class=\"diffrm\">";
... /* nothing here modifies zStart */
sbsWriteText(&s, ...);

gdb details follow:

> (gdb) bt
> #0 0x004147ea in sbsWriteText (p=0x28fce4, pLine=<value optimized out>, flags=<value optimized out>) at src/diff.c:397
> #1 0x00415316 in sbsDiff (pA_Blob=0x28fddc, pB_Blob=0x28fdc8, pOut=0x28fdb4, diffFlags=324009991) at src/diff.c:972
> #2 text_diff (pA_Blob=0x28fddc, pB_Blob=0x28fdc8, pOut=0x28fdb4, diffFlags=324009991) at src/diff.c:1498
> #3 0x00422919 in diff_page () at src/info.c:1112
> #4 0x00427850 in process_one_web_page (zNotFound=<value optimized out>) at src/main.c:1347
> #5 0x00428d15 in main (argc=3, argv=0x3f1ab0) at src/main.c:501
> (gdb) up
> #1 0x00415316 in sbsDiff (pA_Blob=0x28fddc, pB_Blob=0x28fdc8, pOut=0x28fdb4, diffFlags=324009991) at src/diff.c:972
> 972 sbsWriteText(&s, &A[a], SBS_PAD);
> (gdb) set print pretty on
> (gdb) print s
> $6 = {
> zLine = 0x2855548 "<span class=\"diffln\"> 125 </span> <span class=\"diffrm\">#ifnde", ' ' <repeats 56 times>, "<span class=\"diffln\"> 124 </span> #endif\ninclude &lt;sys/mman.h&gt;\nº\rð­º\rð­º\rð­º"...,
> n = 35,
> width = 80,
> escHtml = 1 '\001',
> iStart = 6,
> zStart = 0x7 <Address 0x7 out of bounds>,
> iEnd = 80,
> iStart2 = 0,
> zStart2 = 0x7 <Address 0x7 out of bounds>,
> iEnd2 = 2686280

Benoit Mortgat

unread,
Mar 19, 2012, 6:18:47 AM3/19/12
to Fossil SCM user's discussion
This issue appears to be the same with different compilers then:
Compiling with MinGW, with “CFLAGS=-O0 make -f win/Makefile.mingw”
the problem disappears.

On Mon, Mar 19, 2012 at 11:08, Jos Groot Lipman <dont...@home.nl> wrote:
> I compiled with Visual Studio 2005 and the crash occurs at line 404 in
> diff.c
>   int x = strlen(p->zStart);
> It fails (access violation) because p->zStart is 0x00000050
>
> This happened when I compiled with /Zi (include debug info)
> Debugging is still difficult because of /O2 (optimize for speed) so I tried
> with /Od (no optimizing)
> However, now the problem is gone. I hate that.
>

--

Richard Hipp

unread,
Mar 19, 2012, 8:00:31 AM3/19/12
to Fossil SCM user's discussion
I ran the offending diff through valgrind and it turned up one use of an uninitialized variable, though that use seemed harmless to me.  The fix is at http://www.fossil-scm.org/fossil/info/9262546e43 - can you try this change and see if that clears the problem?  I'm not able to reproduce the problem on linux.

Benoit Mortgat

unread,
Mar 19, 2012, 8:17:28 AM3/19/12
to Fossil SCM user's discussion
On Mon, Mar 19, 2012 at 13:00, Richard Hipp <d...@sqlite.org> wrote:
> I ran the offending diff through valgrind and it turned up one use of an
> uninitialized variable, though that use seemed harmless to me.  The fix is
> at http://www.fossil-scm.org/fossil/info/9262546e43 - can you try this
> change and see if that clears the problem?  I'm not able to reproduce the
> problem on linux.
>

Yes, that clears the problem, thanks.
Still, I fail to understand what failed in the zStart assignment.

Richard Hipp

unread,
Mar 19, 2012, 9:08:00 AM3/19/12
to Fossil SCM user's discussion
On Mon, Mar 19, 2012 at 8:17 AM, Benoit Mortgat <mor...@gmail.com> wrote:
On Mon, Mar 19, 2012 at 13:00, Richard Hipp <d...@sqlite.org> wrote:
> I ran the offending diff through valgrind and it turned up one use of an
> uninitialized variable, though that use seemed harmless to me.  The fix is
> at http://www.fossil-scm.org/fossil/info/9262546e43 - can you try this
> change and see if that clears the problem?  I'm not able to reproduce the
> problem on linux.
>

Yes, that clears the problem, thanks.
Still, I fail to understand what failed in the zStart assignment.

New source code and precompiled binaries for all platforms have now been uploaded.
 

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

Jos Groot Lipman

unread,
Mar 19, 2012, 9:45:29 AM3/19/12
to Fossil SCM user's discussion
It is stable for me too now.
 
I did notice however that the fossil.exe filesize increased from 1115kB to 1324kB, quite a lot for a single memset operation?
 
Jos Groot Lipman


From: fossil-use...@lists.fossil-scm.org [mailto:fossil-use...@lists.fossil-scm.org] On Behalf Of Richard Hipp
Sent: maandag 19 maart 2012 14:08

To: Fossil SCM user's discussion
Subject: Re: [fossil-users] Side-by-side diff broken in version 1.22 on Windows?

Richard Hipp

unread,
Mar 19, 2012, 9:47:11 AM3/19/12
to Fossil SCM user's discussion
On Mon, Mar 19, 2012 at 9:45 AM, Jos Groot Lipman <dont...@home.nl> wrote:
It is stable for me too now.
 
I did notice however that the fossil.exe filesize increased from 1115kB to 1324kB, quite a lot for a single memset operation?

I probably compiled it differently (mingw vs vs2010) or failed to strip out symbols or something like that.

 

Richard Hipp

unread,
Mar 19, 2012, 9:51:39 AM3/19/12
to Fossil SCM user's discussion
On Mon, Mar 19, 2012 at 9:47 AM, Richard Hipp <d...@sqlite.org> wrote:


On Mon, Mar 19, 2012 at 9:45 AM, Jos Groot Lipman <dont...@home.nl> wrote:
It is stable for me too now.
 
I did notice however that the fossil.exe filesize increased from 1115kB to 1324kB, quite a lot for a single memset operation?

I probably compiled it differently (mingw vs vs2010) or failed to strip out symbols or something like that.

Now uploaded yet another windows binary that has been stripped of debug symbols and is hence approximately the same size as the old one.
 
Reply all
Reply to author
Forward
0 new messages