After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 544893 - Crash in web album <gthumb:if/>
Crash in web album <gthumb:if/>
Status: RESOLVED FIXED
Product: gthumb
Classification: Other
Component: general
2.10.x
Other All
: Normal critical
: ---
Assigned To: Paolo Bacchilega
Paolo Bacchilega
Depends on:
Blocks:
 
 
Reported: 2008-07-26 21:23 UTC by William Bell
Modified: 2008-07-31 16:23 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add image context when evaluating <gthumb:if/> (489 bytes, patch)
2008-07-27 08:10 UTC, Christophe Bisière
none Details | Review
The patch fails with the following dataset (10.00 KB, application/x-compressed-tar)
2008-07-30 15:38 UTC, William Bell
  Details
Add image context when evaluating <gthumb:if/> (528 bytes, patch)
2008-07-31 09:01 UTC, Christophe Bisière
committed Details | Review

Description William Bell 2008-07-26 21:23:10 UTC
Steps to reproduce:
1. create a custom web album theme
2. create a put the following statement in thumbnail.ghtml on top.
<gthumb:if thumb_width > thumb_height/>
<p>landscape</p>
<gthumb:end/>


Stack trace:
Segmentation fault

Other information:
the following works, but now the dimension is output, the same problem exists for image_width/height etc.
<gthumb:eval expr=thumb_width/>
<gthumb:if thumb_width > thumb_height/>
<p>landscape</p>
<gthumb:end/>
Comment 1 Christophe Bisière 2008-07-27 08:06:58 UTC
Ho I see. Actually the problem shows up for any image-specific readable variable (image_width, preview_width, thumb_width,...).

Stay tuned. A patch will follow soon...

Christophe
Comment 2 Christophe Bisière 2008-07-27 08:10:38 UTC
Created attachment 115365 [details] [review]
Add image context when evaluating <gthumb:if/>

Applies to svn trunk rev 2358. --Chr.
Comment 3 William Bell 2008-07-28 12:54:23 UTC
Thanks Christophe for the patch and the quick response.

I will test the patch sometime this week.

William

Comment 4 William Bell 2008-07-28 18:35:42 UTC
Christophe

I have applied the patch but it still crashes giving a Segmentation fault.
Could be something to do with my old install as I am unable to install it locally.

Comment 5 Christophe Bisière 2008-07-28 20:35:23 UTC
Mmm, that weird. Would you mind posting a backtrace? 

To do this, follow "Code Listing 1.4" in
http://www.gentoo.org/proj/en/qa/backtraces.xml

Thanks!

Christophe
Comment 6 William Bell 2008-07-28 20:59:28 UTC
(In reply to comment #5)

Christophe the info you were looking for:

wil@williambell:~/bin$ gdb ./gthumb
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) run
Starting program: /home/wil/bin/gthumb 
[Thread debugging using libthread_db enabled]
[New Thread 0xb6a99720 (LWP 2287)]
[New Thread 0xb6675b90 (LWP 2293)]
[New Thread 0xb65eeb90 (LWP 2294)]
[New Thread 0xb64eab90 (LWP 2296)]
[New Thread 0xb5affb90 (LWP 2297)]
[New Thread 0xb5ce9b90 (LWP 2298)]
[New Thread 0xb52feb90 (LWP 2299)]
[New Thread 0xb527db90 (LWP 2300)]
[New Thread 0xb507db90 (LWP 2302)]
[Thread 0xb64eab90 (LWP 2296) exited]
[Thread 0xb507db90 (LWP 2302) exited]
[Thread 0xb5affb90 (LWP 2297) exited]
[New Thread 0xb5affb90 (LWP 2306)]
[New Thread 0xb507db90 (LWP 2307)]
[Thread 0xb507db90 (LWP 2307) exited]
[New Thread 0xb2754b90 (LWP 2309)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6a99720 (LWP 2287)]
0xb2b29e53 in gth_parsed_doc_print (document=0x8999e10, 
    relative_to=0x87cdbf8 "file:///home/wil/webtest", ce=0x8622ba0, 
    fout=0x89eb888, allow_table=1) at catalog-web-exporter.c:1873
1873				idata = g_list_nth (ce->file_list, ce->image)->data;
(gdb) 


Hope it helps
William
Comment 7 Christophe Bisière 2008-07-28 21:22:00 UTC
William,

Thanks for the backtrace.

I suspect we are not working on the same source code, since your source line 1873 is actually 1859 in my current version (which is, I believe, up to date, that is, rev 2358).

If I run "svn diff" from the source dir, I only get:

Index: src/catalog-web-exporter.c
===================================================================
--- src/catalog-web-exporter.c	(révision 2358)
+++ src/catalog-web-exporter.c	(copie de travail)
@@ -1856,6 +1856,8 @@
 			break;
 
 		case GTH_TAG_IF:
+			idata = g_list_nth (ce->file_list, ce->image)->data;
+			ce->eval_image = idata;
 			for (scan = tag->value.cond_list; scan; scan = scan->next) {
 				GthCondition *cond = scan->data;
 				if (expression_value (ce, cond->expr) != 0) {


which is just my patch. If case you don't get the same output, could you please run a "svn update", check again a "svn diff" and then "make && make install"?

Christophe
Comment 8 William Bell 2008-07-29 05:24:45 UTC
Christophe

You are right. If I do a svn update it does not overwrite my existing changes, so maybe I will delete those files and run svn update again. 

Thanks
William
Comment 9 Christophe Bisière 2008-07-29 08:16:38 UTC
William,

Use

  svn revert name-of-the-file-to-revert

e.g.

  svn revert data/glade/gthumb_web_exporter.glade

Christophe
Comment 10 William Bell 2008-07-29 16:34:18 UTC
(In reply to comment #9)

Christophe I have reverted my files, the diff is the same as yours but it still segfaults.




wil@williambell:~/bin$ gdb ./gthumb
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) run
Starting program: /home/wil/bin/gthumb 
[Thread debugging using libthread_db enabled]
[New Thread 0xb6a34720 (LWP 24441)]
[New Thread 0xb6610b90 (LWP 24445)]
[New Thread 0xb6589b90 (LWP 24446)]
[New Thread 0xb648eb90 (LWP 24447)]
[New Thread 0xb5c84b90 (LWP 24448)]
[New Thread 0xb5c03b90 (LWP 24449)]
[New Thread 0xb5b82b90 (LWP 24450)]
[New Thread 0xb57ffb90 (LWP 24452)]
[Thread 0xb57ffb90 (LWP 24452) exited]
[New Thread 0xb57ffb90 (LWP 24453)]
[Thread 0xb648eb90 (LWP 24447) exited]
[New Thread 0xb4bd8b90 (LWP 24454)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb6a34720 (LWP 24441)]
0xb5917ded in gth_parsed_doc_print (document=0x891fa10, 
    relative_to=0x89c5518 "file:///home/wil/webtest", ce=0x8623398, 
    fout=0x89d8460, allow_table=1) at catalog-web-exporter.c:1859
1859				idata = g_list_nth (ce->file_list, ce->image)->data;

Thanks for you efforts so far!
Comment 11 Christophe Bisière 2008-07-29 21:13:09 UTC
William,

I am puzzled!

Could you please post as attachments your index.gthtml, image.gthtml, and thumbnails.gthtml?

Thanks,

Christophe
Comment 12 William Bell 2008-07-30 15:38:35 UTC
Created attachment 115568 [details]
The patch fails with the following dataset
Comment 13 Christophe Bisière 2008-07-31 09:01:27 UTC
Created attachment 115612 [details] [review]
Add image context when evaluating <gthumb:if/> 

William,

Thank you for the files. Could you please try this patch (applies to rev. 2362)?

Best regards,

Christophe
Comment 14 William Bell 2008-07-31 15:54:30 UTC
(In reply to comment #13)

Christophe

The patch works, great!

Thanks for all your help.

Regards
William

Comment 15 Michael Chudobiak 2008-07-31 16:23:50 UTC
Patch committed to trunk and gthumb-2-10 branch. Thanks!

http://svn.gnome.org/viewvc/gthumb?rev=2364&view=rev
http://svn.gnome.org/viewvc/gthumb?rev=2365&view=rev

- Mike