New host: CentOS 7
Running directly on the host, with repositories over sshfs as before:

[email protected]:fossils on /fossils type fuse.sshfs 
(rw,nosuid,nodev,relatime,user_id=0,group_id=0)

I'm not a C dev, so I'm largely unfamiliar with this type of debugging;
let me know if I need to handle this differently somehow. For better
readability, I've also posted the debug output here:

  https://paste.pound-python.org/show/QWBnPqc953rXnFK4pxOg/

```
[root@localhost fossil-2.4]# gdb ./fossil                                       
                                                                                
                                                                                
                                           [45/2179]
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-100.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /root/fossil-2.4/fossil...done.
(gdb) break repo_list_page
Breakpoint 1 at 0x45c1ce: file ./src/main.c, line 1240.
(gdb) run http --repolist /fossils <r1.txt
Starting program: /root/fossil-2.4/./fossil http --repolist /fossils <r1.txt
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, repo_list_page () at ./src/main.c:1240
1240      int n = 0;
Missing separate debuginfos, use: debuginfo-install 
glibc-2.17-196.el7_4.2.x86_64 keyutils-libs-1.5.8-3.el7.x86_64 
krb5-libs-1.15.1-8.el7.x86_64 libcom_err-1.42.9-10.el7.x86_64 
libselinux-2.5-11.el7.x86_64 openssl-libs-1.0.2k-8.el7.x86_64 
pcre-8.32-17.el7.x86_64 zlib-1.2.7-17.el7.x86_64
(gdb) n
1243      assert( g.db==0 );
(gdb) n
1244      if( fossil_strcmp(g.zRepositoryName,"/")==0 && !g.fJail ){
(gdb) n
1264        blob_init(&base, g.zRepositoryName, -1);
(gdb) n
1265        sqlite3_open(":memory:", &g.db);
(gdb) n
1266        db_multi_exec("CREATE TABLE sfile(pathname TEXT);");
(gdb) n
1267        db_multi_exec("CREATE TABLE vfile(pathname);");
(gdb) n
1268        vfile_scan(&base, blob_size(&base), 0, 0, 0);
(gdb) n
1269        db_multi_exec("DELETE FROM sfile WHERE pathname NOT GLOB 
'*[^/].fossil'");
(gdb) n
1270        allRepo = 0;
(gdb) n
1272      @ <html>
(gdb) n
1278      n = db_int(0, "SELECT count(*) FROM sfile");
(gdb) n
1279      if( n>0 ){
(gdb) n
1308        @ <h1>No Repositories Found</h1>
(gdb) n
1310      @ </body>
(gdb) n
1312      cgi_reply();
(gdb) n
HTTP/1.0 200 OK
Date: Thu, 21 Dec 2017 19:02:47 GMT
Connection: close
X-UA-Compatible: IE=edge
X-Frame-Options: SAMEORIGIN
Cache-control: no-cache
Content-Type: text/html; charset=utf-8
Content-Length: 132

<html>
<head>
<base href="http:///"; />
<title>Repository List</title>
</head>
<body>
<h1>No Repositories Found</h1>
</body>
</html>
1313      sqlite3_close(g.db);
(gdb) n
1314      g.db = 0;
(gdb) n
1315      return n;
(gdb) n
1316    }
(gdb) n
process_one_web_page (zNotFound=0x0, pFileGlob=0x0, allowRepoList=1) at 
./src/main.c:1497
1497            }else if( zNotFound ){
(gdb) n
1506              @ <h1>Not Found</h1>
(gdb) n
1507              cgi_set_status(404, "not found");
(gdb) n
1508              cgi_reply();
(gdb) n
HTTP/1.0 404 not found
Date: Thu, 21 Dec 2017 19:03:14 GMT
Connection: close
X-UA-Compatible: IE=edge
X-Frame-Options: SAMEORIGIN
Cache-control: no-cache
Content-Type: text/html; charset=utf-8
Content-Length: 151

<html>
<head>
<base href="http:///"; />
<title>Repository List</title>
</head>
<body>
<h1>No Repositories Found</h1>
</body>
</html>
<h1>Not Found</h1>
1510            return;
(gdb) n
1706    }
(gdb) n
cmd_http () at ./src/main.c:2226
2226    }
(gdb) n
main (argc=4, argv=0x7fffffffe678) at ./src/main.c:768
768       fossil_exit(0);
(gdb) n
[Inferior 1 (process 12740) exited normally]
(gdb) q
[root@localhost fossil-2.4]# ls -alh /fossils/
total 1.6M
drwxr-xr-x   1 foouser foouser    8 Dec 21 14:12 .
dr-xr-xr-x. 18 root    root     259 Dec 21 13:55 ..
-rw-r--r--   1 foouser foouser 272K Dec 21 11:15 archsetup.fossil
-rw-r--r--   1 foouser foouser 224K Dec 21 11:15 guac-install-script.fossil
-rw-r--r--   1 foouser foouser 224K Dec 21 11:15 miscreports.fossil
-rwxrwxrwx   1 foouser foouser 308K Dec 21 14:12 pkgReport.fossil
-rw-r--r--   1 foouser foouser 596K Dec 21 11:31 servercfg.fossil

```

----- On Dec 21, 2017, at 1:40 PM, dewey hylton [email protected] wrote:

> Unfortunately, my first stab at this failed:
> 
> (gdb) break repo_list_page
> Breakpoint 1 at 0x7ccc0: file ./src/main.c, line 1238.
> (gdb) run http --repolist /fossils <getstuff
> Starting program: /root/fossil-2.4/fossil http --repolist /fossils <getstuff
> warning: Error disabling address space randomization: Operation not permitted
> Could not trace the inferior process.
> Error: ptrace: Operation not permittedDuring startup program exited with code
> 127.
> (gdb)
> 
> This was done in the same container which is failing as previously described.
> The host is running rancheros, which is a very stripped down and highly
> customized distribution meant specifically for hosting docker containers. As
> such, I'll have to find a different host and distribution to test this 
> against.
> 
> Things I have learned thus far:
> * fossil fails in a similar way when serving a specific repository file. In 
> this
>  case, the web page presents "Not Found" or something similar.
> * fossil appears to work properly on this mountpoint when not serving; i can
> open
>  one of the repository files, edit, commit, sync back across the network, etc.
> * fossil does serve both a repo file and a directory if these files are copied
>  to a different local directory.
> 
> The filesystem mount looks like this:
> 
>  [email protected]:fossils on /fossils type fuse.sshfs
>  (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
> 
> 
> So ... I'll continue by attempting the same type of thing on a different and
> more complete distribution, outside of a container, so that gdb will work if
> fossil fails there as well. But hopefully someone will spot something in the
> information above and share an "ah-hah" moment.
> 
> Thanks for your assistance thus far.
> 
> ----- On Dec 20, 2017, at 8:35 PM, Richard Hipp [email protected] wrote:
> 
>> On 12/20/17, [email protected] <[email protected]> wrote:
>>> Would someone help me understand what I'm seeing here? I expect a list of
>>> repositories
>>> in the web page output, but am told there are none.
>> 
>> I don't understand it either.
>> 
>> To debug, recompile Fossil with -g and -O0.  Create a HTTP request
>> text file like this:
>> 
>>      GET / HTTP/1.0\n
>>      \n
>> 
>> (The first line is "GET /" and the second line is blank.  The \r
>> characters normally required by HTTP are optional.) Then run fossil in
>> gdb.  Set a breakpoint on the routine repo_list_page and run this
>> command:
>> 
>>    run http --repolist /fossils <r1.txt
>> 
>> Single step through the repolist routine and try to figure out why it
>> is not finding your repository files.  Please let us know what you
>> discover.
>> --
>> D. Richard Hipp
>> [email protected]
>> _______________________________________________
>> fossil-users mailing list
>> [email protected]
> > http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to