I compiled the newlocallab branch this afternoon, and played with it. Several times it crashed, as far as I remember it was when trying to adjust the shape of the ellipse or moving the RT-spot. Of course, all the work done since the file was opened is lost.
I compiled a debug version and got one crash after awhile running in gdb. Unfortunately, gdb reports there's "No stack" so I can't provide a backtrace.
@sguyader Maybe a fallout from my merge of dev into newlocallab?
No matter how I try, I can't reproduce the crash.
Anyway, here's a small cleanup patch (fixes uninitialized members and Clang warnings):
diff --git a/rtengine/improccoordinator.cc b/rtengine/improccoordinator.cc
index f0a2ccc37..5728d4a3c 100644
--- a/rtengine/improccoordinator.cc
+++ b/rtengine/improccoordinator.cc
@@ -169,7 +169,21 @@ ImProcCoordinator::ImProcCoordinator() :
shtonecurveloc(65536, 0),
tonecurveloc(65536, 0),
lightCurveloc(32770, 0),
- locallutili(false), localcutili(false), localskutili(false), localexutili(false), LHutili(false), HHutili(false),
+ locallutili(false),
+ localcutili(false),
+ localskutili(false),
+ localexutili(false),
+ llmasutili(false),
+ lhmasutili(false),
+ lcmasutili(false),
+ lcmasexputili(false),
+ lhmasexputili(false),
+ llmasexputili(false),
+ lcmasSHutili(false),
+ lhmasSHutili(false),
+ llmasSHutili(false),
+ LHutili(false),
+ HHutili(false),
huerefs(500, -100000.f),
huerefblurs(500, -100000.f),
chromarefblurs(500, -100000.f),
diff --git a/rtgui/controlspotpanel.h b/rtgui/controlspotpanel.h
index ba3906df2..57453a531 100644
--- a/rtgui/controlspotpanel.h
+++ b/rtgui/controlspotpanel.h
@@ -249,6 +249,8 @@ private:
bool button1Released();
bool drag1(int modifierKey);
+ using ToolPanel::setDefaults;
+
class ControlSpots:
public Gtk::TreeModel::ColumnRecord
{
diff --git a/rtgui/locallab.cc b/rtgui/locallab.cc
index 9a020066e..6e3845b78 100644
--- a/rtgui/locallab.cc
+++ b/rtgui/locallab.cc
@@ -4041,8 +4041,9 @@ void Locallab::unsubscribe()
void Locallab::colorForValue(double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller)
{
-
- float R, G, B;
+ float R = 0.f;
+ float G = 0.f;
+ float B = 0.f;
if (elemType == ColorCaller::CCET_VERTICAL_BAR) {
valY = 0.5;
I got another crash today, this time when exporting the output (now I remember that the first crash yesterday occurred also when exporting). Could this be due to the fact that was reading the file from a USB drive? Though, I was exporting on the local hard drive.
I'll try again with the above patch applied.
@sguyader Sébastien, I honestly don't think my patch cures anything. A repeatable reproduction would be cool...
@Floessie I know, but it's not easily reproducible here. It just crashed once more, but this time it took longer to get the crash. It doesn't seem to depend on the number of spots, the first time it occurred there were only 4 spots, and a few minutes ago it occurred while working with almost 10 spots, while I was trying to tune the contrast in CBDL on one spot.
Maybe a hint, I was using CBDL on these spots when crashes occurred. I haven't tried with CBDL turned off.
@sguyader
Sometimes, RT crash...when I use "locallab"
Perhaps it's a GUI problem ?
@Pandagrapher could you have a look ?
@Floessie
I will use your patch at my next commit
Thank you :)
jacques
@Floessie @sguyader
I just commit
a) add sliders chroma, gamma, slope to "Color and light" mask
b) use the patch above - thanks to @Floessie
Jacques
I take this issue to ask for an opinion !
I watched the video on the masks from DxO-user (Darktable) on PIXL.US
My english is bad, but from what I have seen,this feature is almost present in locallab.
Certainly in a different form. With "Locallab" no mask to select same "color" as in the 2 examples in the video, and of course there is no clipping of objects-faces using lasso as with Darktable
But if you put the Rt-spot on an object for example one of the leaves of a bouquet of flowers, all the leaves (in the limit of the RT-spot area) with a color close (deltaE adjustable by scope) to that of the leaf on which is the spot, will undergo the same action, whitout action on others colors (flowers, vase, etc;)
Must I work on it, in order to visualize in advance the affected areas, it has little to do with the masks I'm adding - now in Exposure and color and Light, but I think by modifying - or adding "Show modifications whithout mask" and the void "transit_shapedetect"
Thank you
Jacques
@Desmis Jacques, I would find it useful to have a preview of the affected areas. For example, when there are 2 colors close to each other (small deltaE) but if you only want to have the effect on the first color, it would be cool to preview the effect of adjusting scope/spot size/transition before the effect is turned on (it would be faster than having to wait for the effect to be applied, especially if you have multiple spots and computationally heavy effects).
@sguyader
Sébastien, OK je vais regarder ce que je peux faire de simple - sans garantie
I will look what can I do from simple without warranty
But first
a) put "chroma" and "gamma" on Shadows-Highlight mask
b) smooth some procees as I just did for "Exposure"
@sguyader
I tested, tested with multiple Rt-spot, move them, change, delete,.. no crash..
@sguyader
j'obtiens un crash lorsque le spot disparaît du preview et que je relâche la souris. Si je ne relâche pas, tout va bien
I get a crash when the spot disappears from the preview and I release the mouse, If I do not release the mouse, everything is fine
@Desmis
Tu veux dire quoi par "disparait du preview" ?
Tu veux dire quoi par "disparait du preview" ?
Same question here. I cannot reproduce the crash by simply zooming in, dragging the spot out of the preview, and releasing the mouse button.
@sguyader @Floessie
I found a bug in last version when using mask with "Exposure", system crash
The same code, in "Color and Light" no crash...
And before I commit modification for "mask color and light", no crsah wirh Exposure mask....
I search !!
jacques
@Desmis I wasn't using mask with Exposure when I got the crash. I was using CBDL for all my spots.
@sguyader @Floessie
The bug for "exposure" mask is solved...
it was due to using of void "gamma_mask"....
Mais, j'obtiens toujours un crash dans certaines circonstances lorsqu'on déplace un Spot
Supposons une image avec 2 spot (assez petits)
1) le premier en haut à gauche de l'écran
2) le deuxième en bas à droite de l'écran
Si on zoom l'image et q'on déplace le preview pour faire disparaître un des deux spots
Curieux...mais embêtant
jacques
@sguyader
Sébastien
Pour CBDL avec la nouvelle version, pas de crash....sinon celui ci-dessus....
Le crash - du à gamma mask - a été difficile à trouver. il perturbait gravement le fonctionnement
Peux-tu me confirmer le crash que j'obtiens avec mes 2 spots...
je serai absent cet après-midi
jacques
@sguyader @Floessie
I will continue tonight and tomorrow
a) add gamma and chroma for Shadows Highlight mask
b) add some "Soft radius"
c) work on "preview" for "deltaE" ("as" mask in Darktable)
@Desmis Jacques, despite your instructions, I can't make it crash. Here's what I do:
I must be missing something. Please enlighten me. :smile:
@Floessie
You are OK with my text.
I don't understand.. perhaps system, or computer ??
I don't understand.. perhaps system, or computer ??
Definitely. Linux is sometimes more forgiving than Windows. I'll try FreeBSD now...
... no luck on FreeBSD either.
@Floessie
I re-test now.... No crash :)
???
@Desmis @Floessie
I reproduced the crash reported by Jacques on Windows environment (branch at commit 779e429)
Backtrace:
Thread 174 received signal SIGSEGV, Segmentation fault.
[Switching to Thread 12872.0x20e0]
0x00000000008867aa in rtengine::ImProcFunctions::Lab_Local(int, int, float**, rtengine::LabImage*, rtengine::LabImage*, rtengine::LabImage*, int, int, int, int, int, rtengine::LocretigainCurve const&, LUT<float>&, bool&, rtengine::LocLHCurve const&, rtengine::LocHHCurve const&, rtengine::LocCCmaskCurve const&, bool&, rtengine::LocLLmaskCurve const&, bool&, rtengine::LocHHmaskCurve const&, bool&, rtengine::LocCCmaskexpCurve const&, bool&, rtengine::LocLLmaskexpCurve const&, bool&, rtengine::LocHHmaskexpCurve const&, bool&, rtengine::LocCCmaskSHCurve const&, bool&, rtengine::LocLLmaskSHCurve const&, bool&, rtengine::LocHHmaskSHCurve const&, bool&, bool&, bool&, LUT<float>&, bool&, bool&, LUT<float>&, bool&, LUT<float>&, LUT<float>&, LUT<float>&, LUT<float>&, LUT<float>&, double&, double&, double&, double&, double&, double&, double&, int, int, int) [clone ._omp_fn.112] ()
(gdb) bt full
#0 0x00000000008867aa in rtengine::ImProcFunctions::Lab_Local(int, int, float**, rtengine::LabImage*, rtengine::LabImage*, rtengine::LabImage*, int, int, int, int, int, rtengine::LocretigainCurve const&, LUT<float>&, bool&, rtengine::LocLHCurve const&, rtengine::LocHHCurve const&, rtengine::LocCCmaskCurve const&, bool&, rtengine::LocLLmaskCurve const&, bool&, rtengine::LocHHmaskCurve const&, bool&, rtengine::LocCCmaskexpCurve const&, bool&, rtengine::LocLLmaskexpCurve const&, bool&, rtengine::LocHHmaskexpCurve const&, bool&, rtengine::LocCCmaskSHCurve const&, bool&, rtengine::LocLLmaskSHCurve const&, bool&, rtengine::LocHHmaskSHCurve const&, bool&, bool&, bool&, LUT<float>&, bool&, bool&, LUT<float>&, bool&, LUT<float>&, LUT<float>&, LUT<float>&, LUT<float>&, LUT<float>&, double&, double&, double&, double&, double&, double&, double&, int, int, int) [clone ._omp_fn.112] ()
No symbol table info available.
#1 0x000000006360cfb8 in ?? () from C:\msys64\mingw64\bin\libgomp-1.dll
No symbol table info available.
#2 0x0000000064944ce0 in ?? () from C:\msys64\mingw64\bin\libwinpthread-1.dll
No symbol table info available.
#3 0x00007ff82c44b0ba in msvcrt!_beginthreadex ()
from C:\WINDOWS\System32\msvcrt.dll
No symbol table info available.
#4 0x00007ff82c44b18c in msvcrt!_endthreadex ()
from C:\WINDOWS\System32\msvcrt.dll
No symbol table info available.
#5 0x00007ff82dc481f4 in KERNEL32!BaseThreadInitThunk ()
from C:\WINDOWS\System32\kernel32.dll
No symbol table info available.
#6 0x00007ff82e3ba251 in ntdll!RtlUserThreadStart ()
from C:\WINDOWS\SYSTEM32\ntdll.dll
No symbol table info available.
#7 0x0000000000000000 in ?? ()
No symbol table info available.
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Pierre
@Pandagrapher
I try, try again.... no crash ...
But now what do we do with this report ... that I have trouble interpreting ?
@Desmis
Here the pic and .pp3 I used to get the crash: https://we.tl/t-byNJADOk0y
Only Color & Light module is activated for Locallab so problem seems to be in Lab_Local function parts dealing with Color & Light. More precisely this part of the code:
#ifdef _OPENMP
#pragma omp parallel for schedule(dynamic,16)
#endif
for (int ir = 0; ir < bfh; ir++)
for (int jr = 0; jr < bfw; jr++) {
float valLL = 0.f;
float valCC = 0.f;
float valHH = 0.f;
float kmaskL = 0;
float kmaskCa = 0;
float kmaskCb = 0;
float kmaskHL = 0;
float kmaskHa = 0;
float kmaskHb = 0;
if (lp.showmaskcolmet == 2 || lp.enaColorMask || lp.showmaskcolmet == 3) {
if (locllmasCurve && llmasutili) {
float ligh = (bufcolorig->L[ir][jr]) / 32768.f;
valLL = (float)(locllmasCurve[500.f * ligh]);
valLL = LIM01(1.f - valLL);
kmaskL = 32768.f * valLL;
}
if (locccmasCurve && lcmasutili) {
float chromask = 0.0001f + (sqrt(SQR(bufcolorig->a[ir][jr] / fab) + SQR(bufcolorig->b[ir][jr] / fab)));
float chromaskr = chromask;// / 45000.f;
valCC = float (locccmasCurve[500.f * chromaskr]);
valCC = LIM01(1.f - valCC);
kmaskCa = valCC;
kmaskCb = valCC;
}
if (lochhmasCurve && lhmasutili) {
float huema = xatan2f(bufcolorig->b[ir][jr], bufcolorig->a[ir][jr]);
float h = Color::huelab_to_huehsv2(huema);
h += 1.f / 6.f;
if (h > 1.f) {
h -= 1.f;
}
valHH = float (lochhmasCurve[500.f * h]);
valHH = LIM01(1.f - valHH);
kmaskHa = valHH;
kmaskHb = valHH;
kmaskHL = 32768.f * valHH;
}
bufmaskblurcol->L[ir][jr] = CLIPLOC(kmaskL + kmaskHL);
bufmaskblurcol->a[ir][jr] = CLIPC(kmaskCa + kmaskHa);
bufmaskblurcol->b[ir][jr] = CLIPC(kmaskCb + kmaskHb);
ble[ir][jr] = bufmaskblurcol->L[ir][jr] / 32768.f;
guid[ir][jr] = bufcolorig->L[ir][jr] / 32768.f;
}
}
Pierre
@Desmis
In fact, that's due to the function mean_fab. In there, nbfab is initialized at 0 and stayed at zero when spot is outside preview which leads to a division by zero (stddv = sqrt(som / nbfab);). Crash occurs when calculating chromask and trying to access a NaN index for LUTf:
float chromask = 0.0001f + (sqrt(SQR(bufcolorig->a[ir][jr] / fab) + SQR(bufcolorig->b[ir][jr] / fab)));
float chromaskr = chromask;// / 45000.f;
valCC = float (locccmasCurve[500.f * chromaskr]);
I let you correct it: I don't know what behavior you want to have in that case (spot outside preview)
Pierre
@Pandagrapher
I have the same crash with "Exposure" and curiously not with "Shadows Highlight" , which use the same algo with "mean_fab"
If the spot is comptely outside.... there is no utility to do calculation...
jacques
@Pandagrapher
Je viens d'apporter une solution...
Je pousse le changement
Merci
Jacques
Status?
I think we can close :)
Most helpful comment
@Floessie
You are OK with my text.
I don't understand.. perhaps system, or computer ??