yash-p-amd / grafx2

Automatically exported from code.google.com/p/grafx2
1 stars 0 forks source link

Segfault when saving layered gif #258

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Mentioned this on PJ. Here's what gdb has to say:

(gdb) run
Starting program: /home/cameron/Desktop/grafx2/grafx2 
[Thread debugging using libthread_db enabled]
[New Thread 0xb799d8d0 (LWP 29923)]
[New Thread 0xb7766b90 (LWP 29926)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb799d8d0 (LWP 29923)]
0x080c9289 in Save_GIF () at fileformats.c:2218
2218                  GCE_block[4] = 255;
(gdb) 

Lemme know how/if I can provide better debugging info.

Original issue reported on code.google.com by cameron...@comcast.net on 24 Nov 2009 at 10:31

GoogleCodeExporter commented 8 years ago
once in gdb, the first step is to type "bt full" to have a precise log of where 
the 
crash hapenned.
Is there some infos on your configuration ? Os is linux, but 32 or 64bit ? 
which 
distro/version ?

I'll try to reproduce when I get some time.

Original comment by pulkoma...@gmail.com on 24 Nov 2009 at 10:39

GoogleCodeExporter commented 8 years ago
out put with bt full:

(gdb) run
Starting program: /home/cameron/Desktop/grafx2/grafx2 
[Thread debugging using libthread_db enabled]
[New Thread 0xb79e48d0 (LWP 31643)]
[New Thread 0xb77adb90 (LWP 31646)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb79e48d0 (LWP 31643)]
0x080c9289 in Save_GIF () at fileformats.c:2218
2218                  GCE_block[4] = 255;
(gdb) bt full
#0  0x080c9289 in Save_GIF () at fileformats.c:2218
    GCE_block = 0x80f4d88 "!�\004\005\005"
    filename = "/home/cameron/Desktop/foo4.gif\000\000P�\222���ݷ��\222�\f8շ", '\0' <repeats 16 times>, "�
\002\000\000\000\000\000\000t\034Ϸ\000\000\000\000\000\000\000\000�\002\000\0
001\003", '\0' <repeats 14 times>, "\210�
\n\n\001\000\001\000\000\000\000\000\001\000\001\000�\0021\003�
\002\000\000\017\000\000\000\017\000\000\000\017\000\222��\002\v\b)\003\000\
000�\002\000\000��\222�
\020g\v\b)\003\000\000�\002\000\000\017\000\000\000\017\000\000\000\001\000\00
0\000\n\000\000\000��
\222�A\027\n\b\003\000\000\000\214�\222���\a\nq(��\\�"...
    alphabet_prefix = (uint16_t *) 0xa0f3350
    alphabet_suffix = (uint16_t *) 0xa0f5358
    alphabet_daughter = (uint16_t *) 0xa0f7360
    alphabet_sister = (uint16_t *) 0xa0f9368
    alphabet_free = 2547
    alphabet_max = 4095
    start = 1053
    descend = 1
    LSDB = {Width = 1280, Height = 974, Resol = 151 '\227', 
  Backcol = 0 '\0', Aspect = 0 '\0'}
    IDB = {Pos_X = 0, Pos_Y = 0, Image_width = 1280, Image_height = 974, 
  Indicator = 7 '\a', Nb_bits_pixel = 8 '\b'}
    block_identifier = 44 ','
    current_string = 1053
---Type <return> to continue, or q <return> to quit---
    current_char = 0 '\0'
    index = 1054
    old_current_layer = 1 '\001'
#1  0x08087580 in Save_image (image=1 '\001') at loadsave.c:780
    format = (T_Format *) 0x80f7680
    __func__ = "Save_image"
#2  0x08067bea in Save_picture (image=1 '\001') at buttons.c:2943
    initial_file_directory = "/home/cameron/Desktop/grafx2\000\200���C\a\n\001\000\000\000\224�\222�\224�\222��C\a\nP�
\016\n\b�\016\n����\017\000\000\000\230�\016\n��\222�\233\201�
���\230�\016\n\001\000\000\000\224�\222�
\032\000\017\000\017\000\000\000�C\a\000��\222�\n\000\000\000�
\003\000\000&\002=\003\017\000\017\000\017\000\000\000\017\000\000\000@\002\000\
000��\222���\005\b\230�
\016\n&\002\000\000=\003\000\000\017\000\000\000\017\000\000\000&\002\001\000�
�\222�
\n\000\000\000\n\000\000\000�\003\000\000(�\222�F\030\f\b\006\000\001\000&
\002=\003"...
    initial_filename = "NO_NAME.GIF\000H�\222��%Ϸ@\021޷\220\006\017\n\210\006\017\n�/��\210�\222�
\000\000\000\000\230�\222�\207\216��\220\006\017\n\220\006\017\n 
\000\000\000�/\236�0�
\a\n\001\000\000\000\230�\222�\220�\a\n\0006\236�\220\006\017\n\200\006\
017\n����
\000\000\000\000\001\000\000\000\000\000\000\000�/��0�\a\n\001\000\000\0
00��\222�\a���0�\a\n��\222�
\000\000\000\000\001\000\000\000\001\001.\n\000\000\000\000\003\000�\003\000\0
00\000\000\004\000\000\000��
\201\t��\201\t\000\000\000\000����\017\000\000\000��\222�E\017
��0�\a\n"...
    initial_file_format = 3 '\003'
    do_not_restore = 1 '\001'
---Type <return> to continue, or q <return> to quit---
    old_cursor_shape = 1 '\001'
    initial_main_image_width = 1280
    initial_main_image_height = 974
    __func__ = "Save_picture"
#3  0x08067cf6 in Button_Save () at buttons.c:2979
No locals.
#4  0x0808a0a9 in Select_button (btn_number=33, click=1 '\001') at engine.c:447
    family = 3
    b = 45
    icon = -1
#5  0x0808b739 in Main_handler () at engine.c:1224
    button_index = 33
    prev_button_number = 33
    blink = 0 '\0'
    key_index = 245
    str = "Color #33 (239,0,0)     "
    temp = 24 '\030'
    effect_modified = 97 'a'
    action = 0 '\0'
    key_pressed = 79
    temp_color = 0 '\0'
#6  0x0804c18d in main (argc=Cannot access memory at address 0x1
) at main.c:837
    phoenix_found = 0
---Type <return> to continue, or q <return> to quit---
    phoenix2_found = 0
    phoenix_filename1 = "/home/cameron/.grafx2/phoenix.img\000\004\b �ȷ�\210\004\b\001\000\000\000��\002�.N=�(�
\002���\222���\001�\220�\222��\210\004\b\204�\222���
\002�\000\000\000\000 .��
\001\000\000\000\000\000\000\000\001\000\000\000X�\002�\000\000\000\000 
���
\000\000\000\200\001\000\000\000\000\000\000\000\220�\222�\204�\222�", 
'\0' <repeats 12 times>, "��\222�p�\002��
\226\004\b", '\0' <repeats 64 times>, 
"7�\222�N�η�!ڷ�o\017\bx�\222��\235\004\b��ݷ�o\017\b"...
    phoenix_filename2 = "/home/cameron/.grafx2/phoenix2.img", '\0' <repeats 21 times>, "#42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 
2009", '\0' <repeats 22 times>, 
"i686\000\000\000\000\000\000\000\000\000�ȷ\020ii\r8�\222���\001�\0
364ɷ
\004\227\004\b\000\000\000\000\000��� 
.��\002\000\222�h\r\002��\224\004\b\f�����\002��-��
\b\000\000\000��\222���\001�", '\0' <repeats 20 times>, 
"H�\002�\200�\222�\000"...
    __func__ = "main"
(gdb)

I guess bt = backtrace. So that's that's how you do a backtrace...

Anyhoo, running 32-bit LinuxMint 7 Gloria, which is based on Ubuntu Jaunty. 
Kernel is 2.6.28-11-generic. GrafX2 version is r1222

Original comment by cameron...@comcast.net on 24 Nov 2009 at 10:57

GoogleCodeExporter commented 8 years ago
Argh my fault, saving GIF is guaranteed to crash on Linux and all other OSes 
which
are strict about writing in implicit constants.
Thanks again for report.
Pkm: GCE_block was declared as: char * GCE_block = "<constant>";
With char GCE_block[] = ... it would have been ok.

Original comment by yrizoud on 25 Nov 2009 at 2:15

GoogleCodeExporter commented 8 years ago
Hopefully fixed in r1224, but no time to test

Original comment by yrizoud on 25 Nov 2009 at 2:24

GoogleCodeExporter commented 8 years ago
Not tested extensively, but I was able to save a layered gif, load it, make 
changes, and save it again. Seems to be 
working fine.

Original comment by cameron...@comcast.net on 25 Nov 2009 at 2:37

GoogleCodeExporter commented 8 years ago
you should use const char* for this things, actually, unless you change it 
afterwards.

Original comment by pulkoma...@gmail.com on 25 Nov 2009 at 9:39

GoogleCodeExporter commented 8 years ago

Original comment by yrizoud on 1 Dec 2009 at 11:56