Share

Almara Photo Editor

Tracker: Bugs

9 segfault in jpegtran.c with GCC 4.0.2 on debian testing - ID: 1367731
Last Update: Comment added ( jbohac )

Hi JBe,

As I told you in a private conversation, ChT segfaults
in jpegtran.c. I added some debugging printfs and I
think I know what the problem is.

The modified jpegtran.c is attached and this is what I
get on stderr:

jpeg_get_dimensions(/tmp/almara-jb/cht/tmpO1ymzQ/cache0rZLqI,
...) fp = 0xb7c5e258
1 fp = 0xb7c5e258
2 fp = 0xb7c5e258
8 fp = 0xb7c5e258
9 fp = 0xb7c5e258
12 fp = 0x82d6398
13 fp = 0x82d6398
3 fp = 0xb7c5e258
4 fp = 0xb7c5e258

(process:3136): cht-WARNING **: Subprocess pid 3173 is
not running. Trying to relaunch.

It's clear that the error handler is called by
jpeg_read_header(),right after the number 13 in the
stderr output. The problem is, that setjmp() stores the
current stack including the fp pointer, so in the
handler it's back at the uninitialized value! (see the
pointer values in the above output ... different for
lines 13 and 3)


Jirka Bohac ( jbohac ) - 2005-11-27 20:54

9

Closed

Works For Me

Jirka Bohac

ChT

None

Public


Comments ( 3 )




Date: 2006-01-11 23:16
Sender: jbohacProject Admin

Logged In: YES
user_id=892687

Does not happen anymore after Petr's patch-583


Date: 2005-12-10 17:27
Sender: jbencProject Admin

Logged In: YES
user_id=892642

I suggest to set lower -O (does the problem appear even with
-O1?) when gcc 4 is detected by configure.


Date: 2005-12-10 14:00
Sender: jbohacProject Admin

Logged In: YES
user_id=892687

It seems to be a compiler optimization problem (gcc 4.0.2).
Compiling with -O0 fixes the problem as well as modifying
the source in a way that should make no difference.

As this is probably compiler/disto specific, I'll work
around this for the debian package.


Log in to comment.

Attached File ( 1 )

Filename Description Download
jpegtran.c Download

Changes ( 6 )

Field Old Value Date By
status_id Open 2006-01-11 23:16 jbohac
resolution_id None 2006-01-11 23:16 jbohac
close_date - 2006-01-11 23:16 jbohac
assigned_to jbenc 2005-12-10 14:00 jbohac
summary segfault in jpegtran.c 2005-12-10 14:00 jbohac
File Added 157725: jpegtran.c 2005-11-27 20:54 jbohac