Public bug reported:

Shotwell 0.30.14 (Ubuntu 22.04 package)


The expected behaviour

When entering an invalid value (e.g., 0, or extremely large numbers) in the 
"Pixels" field of the export dialog's "Scale limit" option, Shotwell should 
either:
   Display a warning message indicating the value is invalid, or
   Automatically clamp the value to a valid range (e.g., minimum 1 pixel), or
   Disable the export button until a valid value is entered.


What was actually happening
Shotwell crashes immediately with an assertion failure when the user enters 0 
(or 000000) in the pixel field and clicks the export button. The crash occurs 
before the export process even begins.

The assertion failure:
ERROR:src/shotwell.p/dialogs/ExportDialog.c:824:export_dialog_execute: 
assertion failed: (scale > 0)


Similarly, entering a value like 192000 causes a different crash during the 
export process:
ERROR:src/shotwell.p/Photo.c:16804:photo_get_pixbuf_with_options: assertion 
failed: (scaled_to_viewport.approx_equals(Dimensions.for_pixbuf(pixbuf), 
SCALING_FUDGE))


Steps to reproduce the issue
1、Launch Shotwell (version 0.30.14)
2、Select a photo to export
3、Open the Export dialog (File → Export)
4、In the "Format" section, select jpge/png/tiff. In the "Scale limit" section, 
select Width/Height/Longest side.
5、In the "Pixels" field, enter 0 or 192000
6、Click the "Export" button

Observed result: Shotwell crashes immediately with assertion scale > 0 failed.
Alternative test: Enter 192000 in the pixels field, then click Export. The 
export process will start but crash later with a different assertion.


Additional information

System : Ubuntu 22.04 (Linux x86_64)

Backtrace from GDB for the scale > 0 crash:

zsm@zsm-Lenovo-ThinkBook-14p-Gen-2:~$ gdb /usr/bin/shotwell
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
(gdb) run
Starting program: /usr/bin/shotwell 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
.........................
**
ERROR:src/shotwell.p/dialogs/ExportDialog.c:824:export_dialog_execute: 
assertion failed: (scale > 0)
Bail out! 
ERROR:src/shotwell.p/dialogs/ExportDialog.c:824:export_dialog_execute: 
assertion failed: (scale > 0)

Thread 1 "shotwell" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737305052096) at 
./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: 没有那个文件或目录.
(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737305052096) 
at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737305052096) at 
./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737305052096, signo=signo@entry=6) at 
./nptl/pthread_kill.c:89
#3  0x00007ffff6642476 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
#4  0x00007ffff66287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff7c2eb57 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#6  0x00007ffff7c8870f in g_assertion_message_expr () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#7  0x0000555555842be0 in export_dialog_execute ()
#8  0x000055555573350b in  ()
#9  0x00007ffff7d5fd2f in g_closure_invoke () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#10 0x00007ffff7d7bc36 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#11 0x00007ffff7d7d614 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#12 0x00007ffff7d7d863 in g_signal_emit () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#13 0x00007ffff7e90015 in  () at /lib/x86_64-linux-gnu/libgio-2.0.so.0
#14 0x00007ffff7263636 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#15 0x00007ffff7d5fd2f in g_closure_invoke () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#16 0x00007ffff7d7bc36 in  () at /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#17 0x00007ffff7d7d614 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#18 0x00007ffff7d7d863 in g_signal_emit () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#19 0x00007ffff7398ccc in gtk_widget_activate () at 
/lib/x86_64-linux-gnu/libgtk-3.so.0
#20 0x00007ffff72669fe in gtk_menu_shell_activate_item () at 
/lib/x86_64-linux-gnu/libgtk-3.so.0
#21 0x00007ffff7266cd3 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#22 0x00007ffff73e6ec8 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#23 0x00007ffff7d7d700 in g_signal_emit_valist () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#24 0x00007ffff7d7d863 in g_signal_emit () at 
/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#25 0x00007ffff73ae734 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#26 0x00007ffff72516b0 in  () at /lib/x86_64-linux-gnu/libgtk-3.so.0
#27 0x00007ffff725255a in gtk_main_do_event () at 
/lib/x86_64-linux-gnu/libgtk-3.so.0
#28 0x00007ffff792a743 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#29 0x00007ffff7961f56 in  () at /lib/x86_64-linux-gnu/libgdk-3.so.0
#30 0x00007ffff7c65d3b in g_main_context_dispatch () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#31 0x00007ffff7cbb488 in  () at /lib/x86_64-linux-gnu/libglib-2.0.so.0
#32 0x00007ffff7c633e3 in g_main_context_iteration () at 
/lib/x86_64-linux-gnu/libglib-2.0.so.0
#33 0x00007ffff7e8bf95 in g_application_run () at 
/lib/x86_64-linux-gnu/libgio-2.0.so.0
#34 0x00005555557f95bb in application_start ()
#35 0x00005555557017be in library_exec ()
#36 0x00005555555e6c42 in main ()
(gdb) 


(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/bin/shotwell 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
......
L 1189841 2026-04-16 22:28:18 [CRT] dimensions_for_pixbuf: assertion 
'G_TYPE_CHECK_INSTANCE_TYPE (pixbuf, gdk_pixbuf_get_type ())' failed
**
ERROR:src/shotwell.p/Photo.c:16804:photo_get_pixbuf_with_options: assertion 
failed: (scaled_to_viewport.approx_equals(Dimensions.for_pixbuf(pixbuf), 
SCALING_FUDGE))
Bail out! ERROR:src/shotwell.p/Photo.c:16804:photo_get_pixbuf_with_options: 
assertion failed: 
(scaled_to_viewport.approx_equals(Dimensions.for_pixbuf(pixbuf), SCALING_FUDGE))

Thread 1 "shotwell" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737305052096) at 
./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: 没有那个文件或目录.
(gdb)

** Affects: shotwell (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Desktop Bugs, which is subscribed to shotwell in Ubuntu.
https://bugs.launchpad.net/bugs/2148576

Title:
  Export dialog crashes when pixel limit is set to 0 or other invalid
  values

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shotwell/+bug/2148576/+subscriptions


-- 
desktop-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to