Re: [darktable-dev] darktable 2.2.3 crashes on selection of add path

2017-02-17 Thread Ulrich Pegelow

Am 17.02.2017 um 16:07 schrieb Michael Figiel:

Hi,
now I've got two binaries: one crashes and one doesn't. Both are without the
fix, build with pristine 2.2.3 sources:
the not-crashing is build as  RelWithDebInfo, the crashing as Release


I would have expected it the other way round, but OK. Asserts are 
normally only active in debug versions of the program.




To reproduce the crash:
1) start darktable (cli: darktable)
   darktable opens with last visited directory in lighttable (where it
   was last properly shut down)
2) double click a picture in 'lighttable' to open in 'darktable'
   the picture is opened in darktable
3) click on 'correction group'
   the correction group is expanded
4) click on 'spot removal'
   spot removal is expanded
5) click on 'add path' in the 'spot removal' module
   crash, core dump
That's the shortest way to reproduce it, but it ends with a crash if I try
to 'add path' in any other tool/mask.


On my setup the asserts are typically not active, so there is no SIGABRT 
to the program. However, I was nonetheless able to reproduce. The 
incumbent functions are called early when generating a path at a time 
where there is no node defined yet. According safeguards are now 
implemented in master and in the darktable-2.2.x branch.


Thanks for reporting!

Ulrich


___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org



Re: [darktable-dev] darktable 2.2.3 crashes on selection of add path

2017-02-17 Thread Michael Figiel
Hi,
now I've got two binaries: one crashes and one doesn't. Both are without the
fix, build with pristine 2.2.3 sources:
the not-crashing is build as  RelWithDebInfo, the crashing as Release

Btw. the compiler is llvm:
 # clang -v
FreeBSD clang version 3.9.1 (tags/RELEASE_391/final 289601) (based on LLVM 
3.9.1)

> I'm hesitating to just implement this quick fix as the case of a path 
> with zero nodes looks fishy. I'd like to understand better how this 
> happens. Maybe you can help me in two aspects. First thing I would like 
> to learn is what you exactly do in order to produce the crash (you will 
> need to revert the changes).
To reproduce the crash:
1) start darktable (cli: darktable)
   darktable opens with last visited directory in lighttable (where it
   was last properly shut down)
2) double click a picture in 'lighttable' to open in 'darktable'
   the picture is opened in darktable
3) click on 'correction group'
   the correction group is expanded
4) click on 'spot removal'
   spot removal is expanded
5) click on 'add path' in the 'spot removal' module
   crash, core dump
That's the shortest way to reproduce it, but it ends with a crash if I try
to 'add path' in any other tool/mask.
>
> Then it would be great if you could go into path.c, early in function 
> _path_find_self_intersection(). Just add print statements that show with 
> what values for nb_corners and border_count this function gets called. Like:
>
> printf("nb_corners %d, border_count %d\n", nb_corners, border_count);
OK, the results:

* binary with the fix, Release build:
nb_corners 0, border_count 0

* binary without the fix, RelWithDebInfo build:
nb_corners 0, border_count 0

in both cases, if I click and define some points, the following output
lines show numbers > 0; but there is always the first line with both vars == 0.

Other build/fix combinations crash before any output.

kind regards
Michael Figiel
___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org



Re: [darktable-dev] darktable 2.2.3 crashes on selection of add path

2017-02-16 Thread Ulrich Pegelow

Am 16.02.2017 um 10:17 schrieb Michael Figiel:

If this works it implies that this code is called with nb == 0, meaning
a path with no nodes. Which is strange.

I've rebuilt darktable with the line patched and the problem went away,
the paths are usable. Thank you!
To be sure, I built dt without the modification, and it crashed so it
wasn't just the binary package.

As you can't reproduce the behaviour, maybe I can help with diagnostics?
Please don't ask for the core file - I'm on a very slow line, it would take 
ages...


I'm hesitating to just implement this quick fix as the case of a path 
with zero nodes looks fishy. I'd like to understand better how this 
happens. Maybe you can help me in two aspects. First thing I would like 
to learn is what you exactly do in order to produce the crash (you will 
need to revert the changes).


Then it would be great if you could go into path.c, early in function 
_path_find_self_intersection(). Just add print statements that show with 
what values for nb_corners and border_count this function gets called. Like:


printf("nb_corners %d, border_count %d\n", nb_corners, border_count);

For this to work you will need to put in my fix again.

Best wishes

Ulrich


___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org



Re: [darktable-dev] darktable 2.2.3 crashes on selection of add path

2017-02-16 Thread Michael Figiel
Hello Ulrich,
> If you can compile from source you might try to replace
>
>intersections = dt_masks_dynbuf_init(10 * nb, "path intersections");
>
> by
>
>intersections = dt_masks_dynbuf_init(MAX(10 * nb, 100), "path 
> intersections");
>
> If this works it implies that this code is called with nb == 0, meaning 
> a path with no nodes. Which is strange.
I've rebuilt darktable with the line patched and the problem went away,
the paths are usable. Thank you!
To be sure, I built dt without the modification, and it crashed so it
wasn't just the binary package.

As you can't reproduce the behaviour, maybe I can help with diagnostics?
Please don't ask for the core file - I'm on a very slow line, it would take 
ages...

kind regards
Michael Figiel
___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org



Re: [darktable-dev] darktable 2.2.3 crashes on selection of add path

2017-02-15 Thread Ulrich Pegelow

Hi,

I can't reproduce here but judging from your description I assume that 
the issue gets triggered in path.c line 529.


If you can compile from source you might try to replace

  intersections = dt_masks_dynbuf_init(10 * nb, "path intersections");

by

  intersections = dt_masks_dynbuf_init(MAX(10 * nb, 100), "path 
intersections");


If this works it implies that this code is called with nb == 0, meaning 
a path with no nodes. Which is strange.


Ulrich

Am 16.02.2017 um 00:11 schrieb Michael Figiel:

Hello,
darktable reproducible crashes if I try to select 'add path' in any tool
(e.g. in 'spot removal' or in monochrome->blending->'drawn mask'):

Assertion failed: (size > 0), function dt_masks_dynbuf_init, file 
/wrkdirs/usr/ports/graphics/darktable/work/darktable-2.2.3/src/develop/masks.h, 
line 324.
Abort trap (core dumped)

'add circle' and 'add ellipse' in the same tool work without any problems.

darktable version: 2.2.3 (binary package from FreeBSD repo)
OS: FreeBSD 11-STABLE amd64

kind regards
Michael Figiel


___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org



[darktable-dev] darktable 2.2.3 crashes on selection of add path

2017-02-15 Thread Michael Figiel
Hello,
darktable reproducible crashes if I try to select 'add path' in any tool
(e.g. in 'spot removal' or in monochrome->blending->'drawn mask'):

Assertion failed: (size > 0), function dt_masks_dynbuf_init, file 
/wrkdirs/usr/ports/graphics/darktable/work/darktable-2.2.3/src/develop/masks.h, 
line 324.
Abort trap (core dumped)

'add circle' and 'add ellipse' in the same tool work without any problems.

darktable version: 2.2.3 (binary package from FreeBSD repo)
OS: FreeBSD 11-STABLE amd64

kind regards
Michael Figiel
___
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org