[Therion] Therion log file truncated prematurely

Matěj Plch plch.matej at gmail.com
Mon Jan 8 10:43:14 CET 2024


Hi,
I have recently changed backend of therion logging in this commit
https://github.com/therion/therion/commit/5b60074328476b860ea35d48da0d6add4892ea12,
so that is maybe when it stopped working. But I see two reasons why this
bug happens:
1. Original implementation did not explicitly flush the output stream, but
it apparently relied on some implicit flushing, which the current
implementation does not do. Fix would be to add an explicit flush.
2. Thlogfile output should get closed in its destructor, which would
properly write all the data, but it is possibly never destructed. Solution
would be to reimplement thlogfile as a proper singleton, not just a global
variable.

I can prepare a quick fix with 1., but 2. should also get fixed in the
future.

Matěj

so 6. 1. 2024 v 0:18 odesílatel Bruce Mutton <bruce at tomo.co.nz> napsal:

> Recently I’ve noticed some of my therion log files are truncated.  They
> end prematurely.
>
> Only happens with some thconfig files and while the location of the
> truncation is often consistent within each file, it can change with
> subsequent compile runs as well.
>
> Noticed this while trying to debug a presumably unrelated issue.
>
> Some examples below.
>
>
>
> Any insights as to why this might happen?
>
>
>
> Bruce
>
> on Windows 10 Home v 22H2
>
>
>
>
>
>
>
> Another example.
>
>
>
> therion 6.2.0 (2023-12-21)
>
>   - using Proj 9.3.0, compiled against 9.3.0
>
> initialization file: C:\Program Files\Therion/therion.ini
>
> reading ... done
>
> configuration file: thconfig-DwarfsDoor.thc
>
> reading ... done
>
> reading source files ... done
>
> preprocessing database ... done
>
> output coordinate system: EPSG:2193
>
> meridian convergence (deg): -0.0685
>
> geomag declinations (deg):
>
>   1992.1.1  21.3626
>
>   1993.1.1  21.3859
>
>
>
> …and the log proceeds normally until a line is truncated mid-sentence…
>
> 0.27%    0.4m  146.4m  30    0.2m    0.0m    0.4m [sn45.31 at 118.MiddleEarth
> - 118.64 - 118.63 - 118.62 - 118.61 - 118.60 - 118.56 - 118.66 - 78.12 =
> 78.12 at 78.MiddleEarth - 78.11 - 78.10 - 78.9 - 78.8 - 78.7 - 78.6 - 78.5 -
> 78.4 - 78.3 - 78.2 - 78.1 - 77.12 = 77.12 at 77.MiddleEarth -
> 77.11
>
>
>
>
>
>
> In this case some loops are missing and scrap distortions and CRS
> transformations are missing.
>
>
>
> But the log file truncation can happen anywhere, as in the screenshot
> below…
>
>
>
> _______________________________________________
> Therion mailing list
> Therion at speleo.sk
> https://mailman.speleo.sk/listinfo/therion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20240108/3407f33c/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 20637 bytes
Desc: not available
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20240108/3407f33c/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 119448 bytes
Desc: not available
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20240108/3407f33c/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 54103 bytes
Desc: not available
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20240108/3407f33c/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image010.png
Type: image/png
Size: 224449 bytes
Desc: not available
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20240108/3407f33c/attachment-0007.png>


More information about the Therion mailing list