Bug 165846 - Applying Chi Squared random number with 0 nu Value asserts in random.h
Summary: Applying Chi Squared random number with 0 nu Value asserts in random.h
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
25.8.0.0 alpha0+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:26.2.0 target:25.8.2
Keywords: haveBacktrace
Depends on:
Blocks: Crash-Assert
  Show dependency treegraph
 
Reported: 2025-03-21 10:02 UTC by Buovjaga
Modified: 2025-09-24 16:31 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Backtrace from debug build (9.94 KB, text/plain)
2025-03-21 10:02 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buovjaga 2025-03-21 10:02:21 UTC
Created attachment 199935 [details]
Backtrace from debug build

Use a debug build.

1. In Calc, Sheet - Fills Cells - Fill Random Number
2. Select Distribution: Chi Squared and let the nu Value be 0 and apply

/usr/include/c++/14.2.1/bits/random.h:2591: std::gamma_distribution<_RealType>::param_type::param_type(_RealType, _RealType) [with _RealType = double]: Assertion '_M_alpha > _RealType(0)' failed.

The dialog code is in https://git.libreoffice.org/core/+/refs/heads/master/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx
Comment 1 Andreas Heinisch 2025-09-03 19:07:11 UTC
Confirmed in:
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3f5dc4ac382c2b3933793993be4cd07aef89325d
CPU threads: 32; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: en-GB (de_DE); UI: en-US
Calc: CL threaded
Comment 2 Commit Notification 2025-09-16 19:12:36 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/dedaf2a87bca8b903fc42f441c7185921cf03312

tdf#165846 - Ensure degrees of freedom (nu value) is greater than 0

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Commit Notification 2025-09-17 09:49:29 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/a0ec84c050855840f7a829dd7fe6e56fd72d960a

tdf#165846 - Ensure degrees of freedom (nu value) is greater than 0

It will be available in 25.8.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Buovjaga 2025-09-17 13:23:28 UTC
I verify that now it can't be set to 0

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 713530d116c5fdeb3300049826c8ee454f24a219
CPU threads: 8; OS: Linux 6.16; UI render: default; VCL: gtk3
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: CL threaded
Comment 5 Commit Notification 2025-09-24 16:31:06 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/091ad8440e15762daad5f20cabb12e201686b234

tdf#168520 - Rename tdf165846 to tdf165846_nu_min_value

It will be available in 26.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.