Commit graph

4837 commits

Author SHA1 Message Date
Ashod Nakashian
6cd1d511be wsd: avoid segfault when handling invalid paste command
The payload of paste can't have length 0.

Now we silently skip such cases, although perhaps we
should be more strict and disconnect the offending
client.

Change-Id: Iaa2e7373277f9e7d85209aec56a2f8ee0ef7e801
Reviewed-on: https://gerrit.libreoffice.org/34112
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-10 07:02:26 +00:00
Miklos Vajna
04b591b8c6 tools: remove unused using declarations in Stress
Change-Id: Icf4ca0f7532d0254513d5dd47f7914a52c60e46e
2017-02-09 10:09:38 +01:00
Ashod Nakashian
31fc9e1db2 wsd: fix fuzzer build
Change-Id: I121e5e24198e8906af27300752919592283bdb11
Reviewed-on: https://gerrit.libreoffice.org/34054
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-09 04:50:18 +00:00
Ashod Nakashian
3fb136170f wsd: extend timeout when nocaps is specified
Change-Id: Id10b38716cc184bf899120bbe18d9095fd2f48e5
Reviewed-on: https://gerrit.libreoffice.org/34053
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-09 04:36:17 +00:00
Ashod Nakashian
1e42b530e6 wsd: read memory RSS directly from /proc/pid/stat
There is no need to use `ps` here as reading
directly is trivial and has far less overhead.

Change-Id: I27d0432c1f3a9d35763d67fc445d8bd828f1b27e
Reviewed-on: https://gerrit.libreoffice.org/34052
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-09 04:35:24 +00:00
Ashod Nakashian
404111877a wsd: broadcast client messages from WSD not from the Kit
Change-Id: I9c179a2f41a0aaeef35b84208be8ab91af9ee53a
Reviewed-on: https://gerrit.libreoffice.org/34051
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-09 04:27:27 +00:00
Jan Holesovsky
963aeb5d1f Don't leak children that did not manage to send their PID to wsd. 2017-02-09 00:09:21 +01:00
Jan Holesovsky
c49e810437 Avoid crash on exit with trace file disabled. 2017-02-08 22:57:50 +01:00
Jan Holesovsky
ad20adce1a fuzzer: Don't handle signals when fuzzing.
Change-Id: I2febdf96bcbbd5c6edaf791d99a77674e6f0b0a9
2017-02-08 21:39:55 +01:00
Jan Holesovsky
cb3ccfe32d Fix crash on exit in the Admin console.
Change-Id: I5f90a12eb95f59d2b52a52e59526488b94975387
2017-02-08 21:39:10 +01:00
Jan Holesovsky
cd90d8adfe fuzzer: Add --dummy-lok command line option that bypases LibreOffice.
When provided, the DummyLibreOfficeKit is used instead of the real one that
calls LibreOffice.

Change-Id: Ic170d7b4adb72ba17a2b066c509c2b1e657dbccf
2017-02-08 12:34:16 +01:00
Jan Holesovsky
5873d15c62 fuzzer: Use the dummy LOK implementation when fuzzing.
Now it is possible to use:

  ./loolwsd_fuzzer --config-file=loolwsd.xml --o:storage.filesystem[@allow]=true --o:logging.level=fatal --fuzz=/tmp/looltrace

Ie. no need to specify the LibreOffice install location.  Ideally worth
disabling the logging output too, to gain higher performance.

Change-Id: I4fa5f275cd4f4a52fe2cd07e658cea726f6f31c2
2017-02-08 11:54:50 +01:00
Jan Holesovsky
ee79577960 fuzzer: Add a dummy LibreOfficeKit implementation.
This just returns empty values (or does nothing), instead of calling the real
LibreOffice.

Change-Id: Ie6fe0b554056ba73067a76c22067f088e1346b59
2017-02-08 11:25:21 +01:00
Jan Holesovsky
6dd581f635 fuzzer; Added --fuzz param that takes a looltrace file as input.
To perform one fuzzing iteration, use something like:

  ./loolwsd_fuzzer --config-file=loolwsd.xml --o:lo_template_path="/opt/libreoffice/instdir" --o:storage.filesystem[@allow]=true --fuzz=/tmp/looltrace

Change-Id: I27210d55a65f75e7d51e05c2f5f999acb758c4b1
2017-02-08 08:35:13 +01:00
Jan Holesovsky
964ae25ccf fuzzer: Factor out the replay functionality to a separate file.
Change-Id: Ief946b1703ef1ca0b17de3467dce66b4c3da2601
2017-02-08 08:35:13 +01:00
Miklos Vajna
836af6724f wsd: fix -Werror,-Wunused-function
Change-Id: I957440a2ac78f89d2f74aad66813b1ef56b5b532
2017-02-08 08:29:10 +01:00
Michael Meeks
e3e2a5eeee WaE: add missing bracket. 2017-02-07 20:07:37 +00:00
Michael Meeks
e662b3457a AdminConsole: add new propchange notification, and update memory live. 2017-02-07 18:55:32 +00:00
Michael Meeks
9ec0466c57 Admin - measure dirty memory of kits, and RSS of forkit.
Gives a more accurate real memory consumption for each process.
2017-02-07 18:55:32 +00:00
Andras Timar
69ea3a2721 wsd: typo: Conection -> Connection
Change-Id: I4f46298cde972504aa90028344f0c43eb5660ebf
2017-02-07 13:47:03 +01:00
Jan Holesovsky
04d7ed9d09 fuzzer: Make the shared loolwsd and loolforkit binary actually work.
Change-Id: If6ee9f22d93aa040f94df86b30fdc8a0a1ad68e2
2017-02-07 13:27:14 +01:00
Jan Holesovsky
0dac1c4321 fuzzer: Compile a separate binary that contains both loolwsd and loolforkit.
Change-Id: I158e4b19d0929de03f09645c106aebfdbc44ea74
2017-02-07 13:27:14 +01:00
Jan Holesovsky
02e118387a Avoid including LibreOfficeKit.h.
Change-Id: I112b79790839352ffd0d82394ffc7e2d8e8dcf44
2017-02-07 13:27:14 +01:00
Miklos Vajna
98b02fb9c4 common: unused using declaration in Session
Change-Id: I0122b6ad6f5d0e47a2b3c153cdd5e65a7adc6040
2017-02-07 09:08:38 +01:00
Jan Holesovsky
898b5d9e4c Treat the rest of the line as payload, because it may contain the delimiter.
Change-Id: I883f41727cf46c4b71484d2b99144ae7e30ef6d3
2017-02-06 13:36:54 +01:00
Miklos Vajna
18f40e89e1 common: avoid unnecessary value parameter in MessageQueue
Change-Id: I4cefc2658eea75091219e534db25f5ab5877c0c4
2017-02-06 09:30:44 +01:00
Ashod Nakashian
11c08d7663 wsd: remove logging of detailed memory stats
Change-Id: Id804cc342d786e745d7ac214ea72b198bf0b639b
2017-02-05 22:08:23 -05:00
Ashod Nakashian
7d58df49fa wsd: new config to enable/disable snapshots when recording trace
By default snapshots are disabled, since trace recording
is enabled, to avoid unexpectedly flooding the disk.

Change-Id: I6c8728e14801f0a72accde1378455ec0e6046e3e
2017-02-05 22:03:18 -05:00
Ashod Nakashian
57212b69b8 wsd: take snapshot of source file before trace recording
Change-Id: Ia3e25467a20d2442dcf0497c21a8fdce2efedbc2
2017-02-05 21:59:23 -05:00
Ashod Nakashian
64335b4127 wsd: correctly initialize forkit pid in Admin
Change-Id: I376742fa324f207d77fa290046657f17f8872b27
2017-02-05 21:59:23 -05:00
Ashod Nakashian
a7afc59e51 wsd: trace files support timestamp to prevent overwritting on restart
Change-Id: Ided928e7428d35f9ed322720ea306e090bdd0c38
2017-02-05 21:59:23 -05:00
Ashod Nakashian
0476d1d9f2 wsd: don't complain to the user on idle termination
We no longer tell the clinet "This is embarrassing..."
when we disconnect and unload an idle document. Instead,
the client UI remains greyed out so the user can resume
as if it was inactive (and reload the document in this case).

Also, we now always send the "close: " message prior
to shutting down a client websocket. This is more
reasonable and consistent when we intentionally disconnect,
so clients can rely on it to signal intent and give reason.

Otherwise, a disconnection without this application-level
message should be unexpected and is therefore reasonable
to show the "This is embarrassing..." message.

Change-Id: Ic7439bcc9267be155586ccd5d122e9fe60225516
2017-02-05 21:59:23 -05:00
Ashod Nakashian
b095e06173 wsd: fix crash when unloading idle documents
A race condition between the client socket thread
and the idle-document cleanup caused segfault
on the websocket.

Now the ChildProcess object doesn't reset
the websocket on closing, rather on destruction.

Change-Id: I10d0dfb1ba677a65479df85b7a53de8c5f1b44c3
2017-02-05 21:59:23 -05:00
Ashod Nakashian
5cac95e6a9 loleaflet: remove pagepartrectangles request and handling in loleaflet
Change-Id: Ib83e7c0ca05a7d7d1a3d30675ef3cf5804f5ac4c
2017-02-05 21:59:22 -05:00
Ashod Nakashian
5dad626b6d wsd: remove handling of depricated partpagerectangles command
Change-Id: I13285e83179ab7654b6fd21a6548730e74d67425
2017-02-05 21:59:22 -05:00
Henry Castro
174154093b loleaflet: add annotations 2017-02-05 20:24:18 -04:00
Pranav Kant
53bdbce4c1 Disable these tiled comment rendering related tests
We have enabled LOK_FEATURE_NO_TILED_ANNOTATIONS flag already
in Kit.cpp, which means these tests, which assume comments are
rendered as tiles, are no longer relevant, so lets disable them
for now. Surely sometime in future they would completely be
removed and replaced by new tests that assume comments are *not*
rendered in tiles and rather are added/modified/removed by using
comments API. See LOK_CALLBACK_COMMENT for details.

Change-Id: I48b7a0a0aa116d164a3654618ab0e95252d29cf3
2017-02-04 22:33:35 +05:30
Ashod Nakashian
386dc679a5 wsd: get system thread-id directly as not in Poco yet
Change-Id: I49ba23b6cd50c2d9058e9803d7f65ec41277297b
Reviewed-on: https://gerrit.libreoffice.org/33890
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 16:01:52 +00:00
Samuel Mehrbrodt
1f2d04a5e4 Online, not on-line
Change-Id: I93a8322dceca7c1ed95449c6aeb4ae854b982957
Reviewed-on: https://gerrit.libreoffice.org/33886
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2017-02-03 13:47:30 +00:00
Ashod Nakashian
d7a9a76ddb wsd: report PSS of kit processes
Each Kit process now reports its own PSS,
which is much more accurate as they share
a significant ratio of their pages with
one another.

Admin tracks the PSS values of the Kits
and reports to the console.

Change-Id: Ifa66d17749c224f0dc211db80c44f7c913f2d6c4
Reviewed-on: https://gerrit.libreoffice.org/33864
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:12:31 +00:00
Ashod Nakashian
ae8c352928 wsd: access AdminModel instance under lock
Change-Id: I6c5c07dafa69f052ee81e7cbecb4d1f2b772fef9
Reviewed-on: https://gerrit.libreoffice.org/33863
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:08:58 +00:00
Ashod Nakashian
b9a7e1ef03 wsd: improved test and cosmetics
Change-Id: I25a0a27c12394f41af8e021b72627b1c0537a166
Reviewed-on: https://gerrit.libreoffice.org/33862
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:08:43 +00:00
Ashod Nakashian
cd4e8205cf wsd: add getTokenInteger to Message
Change-Id: I2c145aa088082ef056b92c9864b34d8cc2f737cd
Reviewed-on: https://gerrit.libreoffice.org/33861
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:08:16 +00:00
Ashod Nakashian
cd85d8a7f1 wsd: improved protocol helpers
Change-Id: I434fd9d6bb3248a8b9c27bb6c8565369c95786b5
Reviewed-on: https://gerrit.libreoffice.org/33860
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:07:38 +00:00
Ashod Nakashian
4eed11e2be wsd: Admin logging updated
Change-Id: I7d7e0f98f10ae3ef10ca15cf6ad510a3d7bab00e
Reviewed-on: https://gerrit.libreoffice.org/33859
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:06:06 +00:00
Ashod Nakashian
e325bc2978 wsd: ensure test doc is closed before reloading
This reduces the chance for random test failures.

Change-Id: I961a502d57a3cb4946b3b7febc6e6b03e7f36aa1
Reviewed-on: https://gerrit.libreoffice.org/33858
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:05:23 +00:00
Ashod Nakashian
c22e69e9e6 wsd: correct logging of thread ID in log entries
Change-Id: I10aaeeea8df2757362482a405b7525542d150178
Reviewed-on: https://gerrit.libreoffice.org/33857
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:05:06 +00:00
Ashod Nakashian
942aedb414 wsd: AdminModel logging update
Change-Id: Ia9225d4778b69f6417d4025876d7e9560918b05b
Reviewed-on: https://gerrit.libreoffice.org/33856
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
2017-02-03 07:04:41 +00:00
László Németh
3616b4a6a8 wsd: fix snap support
- add loolwsd option --config-file=path

- search all data files in the actual data directory
  instead of the default one.

(cherry-picked from commit c4e9681fd17381c7af2936726262d7357a7dda10)

Change-Id: I028ff8a696aa6336da55bcac2952f13b12ba8eb8
Reviewed-on: https://gerrit.libreoffice.org/33504
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-02-01 14:24:48 +01:00
László Németh
57abb860f4 add alternative Poco library search path for loolforkit and loolmount
These executables are binaries with Linux capabilities, in which case
LD_LIBRARY_PATH is ignored. As a workaround, we can use rpath to support
the alternative Poco library path of a "classic" snap package.

(cherry-picked from commit 74bc911efbf4882f389a49c8e627e7e8057d4a4b)

Change-Id: I23c1d58cce64875abb9629943bfffd7ea633b2bc
Reviewed-on: https://gerrit.libreoffice.org/33705
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
2017-02-01 14:23:51 +01:00