Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#490 closed defect (fixed)

MERGE tool crashes on save-as

Reported by: epruesse Owned by: westram
Priority: blocker Milestone: arb6
Component: no idea Version: SVN
Keywords: Cc: fog@…

Description (last modified by westram)

Click on any file in save-as dialog results in crash.

Change History (12)

comment:1 Changed 10 years ago by epruesse

  • Cc fog@… added

comment:2 Changed 10 years ago by westram

  • Owner changed from devel to westram
  • Status changed from new to assigned

comment:3 Changed 10 years ago by westram

I only get a crash if i click on a directory:

(gdb) whe
#0  __strcmp_sse42 () at ../sysdeps/x86_64/multiarch/strcmp.S:1129
#1  0x00000000005ece53 in filename_changed_cb (awr=0x9f3ce0, awar_base_name=0x71477f "tmp/merge/dst/db") at MG_main.cxx:404
#2  0x000000000059c02e in StrictlyTypedCallback<void, AW_root*, long, long>::operator() (this=0xc10498, p1=0x9f3ce0, p2=7423871, p3=0) at /home/ralf/ARB-bilbo/ARB.trunk.fix/INCLUDE/cbtypes.h:117
#3  0x000000000059be24 in Callback_FVV<void, AW_root*>::operator() (this=0xc10498, fixed=0x9f3ce0) at /home/ralf/ARB-bilbo/ARB.trunk.fix/INCLUDE/cbtypes.h:172
#4  0x00007ffff6ecb795 in AW_root_cblist::call (this=0xc10490, root=0x9f3ce0) at aw_nawar.hxx:47
#5  0x00007ffff6ecb77e in AW_root_cblist::call (this=0xb51060, root=0x9f3ce0) at aw_nawar.hxx:46
#6  0x00007ffff6ecb77e in AW_root_cblist::call (this=0xc3e980, root=0x9f3ce0) at aw_nawar.hxx:46
#7  0x00007ffff6ecb77e in AW_root_cblist::call (this=0xc3ee10, root=0x9f3ce0) at aw_nawar.hxx:46
#8  0x00007ffff6ecb8f5 in AW_root_cblist::call (listhead=@0xc10198, root=0x9f3ce0) at aw_nawar.hxx:68
#9  0x00007ffff6ec9a8f in AW_awar::run_callbacks (this=0xc10180) at AW_awar.cxx:558
#10 0x00007ffff6ec916e in AW_awar::update (this=0xc10180) at AW_awar.cxx:413
#11 0x00007ffff6ec8517 in AW_var_gbdata_callback (awar=0xc10180) at AW_awar.cxx:244
#12 0x00007ffff7ab8378 in StrictlyTypedCallback<void, GBDATA*, long, GB_CB_TYPE>::operator() (this=0x7fffffffcf60, p1=0xc74a88, p2=12648832, p3=GB_CB_CHANGED) at /home/ralf/ARB-bilbo/ARB.trunk.fix/INCLUDE/cbtypes.h:117
#13 0x00007ffff7ab7274 in Callback_FVF<void, GBDATA*, GB_CB_TYPE>::operator() (this=0xc102c0, f1=0xc74a88, f2=GB_CB_CHANGED) at /home/ralf/ARB-bilbo/ARB.trunk.fix/INCLUDE/cbtypes.h:230
#14 0x00007ffff7ab4ca8 in TypedDatabaseCallback::operator() (this=0xc102c0, gbd=0xc74a88, type_=GB_CB_CHANGED) at gb_cb.h:44
#15 0x00007ffff7ab5069 in gb_callback::call (this=0xc102c0, with=0xc74a88, typemask=GB_CB_CHANGED) at gb_cb.h:113
#16 0x00007ffff7ab50ea in gb_callback_list::call (this=0xc10290, with=0xc74a88, typemask=GB_CB_CHANGED) at gb_cb.h:132
#17 0x00007ffff7a82fd2 in gb_do_callbacks (gbd=0xc74a88) at arbdb.cxx:1124
#18 0x00007ffff7a8379c in GB_write_pntr (gbd=0xc74a88, s=0x7ffff6f158d0 "", bytes_size=1, stored_size=0) at arbdb.cxx:1277
#19 0x00007ffff7a838d6 in GB_write_string (gbd=0xc74a88, s=0x7ffff6f158d0 "") at arbdb.cxx:1312
#20 0x00007ffff6ec7711 in AW_awar::write_string (this=0xc10180, para=0x7ffff6f158d0 "") at AW_awar.cxx:144
#21 0x00007ffff6edf5c6 in fileselection_filename_changed_cb (cbs=0xb51e30) at AW_file.cxx:533
#22 0x000000000059c02e in StrictlyTypedCallback<void, AW_root*, long, long>::operator() (this=0xb51068, p1=0x9f3ce0, p2=11869744, p3=0) at /home/ralf/ARB-bilbo/ARB.trunk.fix/INCLUDE/cbtypes.h:117
#23 0x000000000059be24 in Callback_FVV<void, AW_root*>::operator() (this=0xb51068, fixed=0x9f3ce0) at /home/ralf/ARB-bilbo/ARB.trunk.fix/INCLUDE/cbtypes.h:172
#24 0x00007ffff6ecb795 in AW_root_cblist::call (this=0xb51060, root=0x9f3ce0) at aw_nawar.hxx:47
#25 0x00007ffff6ecb77e in AW_root_cblist::call (this=0xc3e980, root=0x9f3ce0) at aw_nawar.hxx:46
#26 0x00007ffff6ecb77e in AW_root_cblist::call (this=0xc3ee10, root=0x9f3ce0) at aw_nawar.hxx:46
#27 0x00007ffff6ecb8f5 in AW_root_cblist::call (listhead=@0xc10198, root=0x9f3ce0) at aw_nawar.hxx:68
#28 0x00007ffff6ec9a8f in AW_awar::run_callbacks (this=0xc10180) at AW_awar.cxx:558
#29 0x00007ffff6ec916e in AW_awar::update (this=0xc10180) at AW_awar.cxx:413
#30 0x00007ffff6ec8517 in AW_var_gbdata_callback (awar=0xc10180) at AW_awar.cxx:244
#31 0x00007ffff7ab8378 in StrictlyTypedCallback<void, GBDATA*, long, GB_CB_TYPE>::operator() (this=0x7fffffffd460, p1=0xc74a88, p2=12648832, p3=GB_CB_CHANGED) at /home/ralf/ARB-bilbo/ARB.trunk.fix/INCLUDE/cbtypes.h:117
#32 0x00007ffff7ab7274 in Callback_FVF<void, GBDATA*, GB_CB_TYPE>::operator() (this=0xc102c0, f1=0xc74a88, f2=GB_CB_CHANGED) at /home/ralf/ARB-bilbo/ARB.trunk.fix/INCLUDE/cbtypes.h:230
#33 0x00007ffff7ab4ca8 in TypedDatabaseCallback::operator() (this=0xc102c0, gbd=0xc74a88, type_=GB_CB_CHANGED) at gb_cb.h:44
#34 0x00007ffff7ab5069 in gb_callback::call (this=0xc102c0, with=0xc74a88, typemask=GB_CB_CHANGED) at gb_cb.h:113
#35 0x00007ffff7ab50ea in gb_callback_list::call (this=0xc10290, with=0xc74a88, typemask=GB_CB_CHANGED) at gb_cb.h:132
#36 0x00007ffff7a82fd2 in gb_do_callbacks (gbd=0xc74a88) at arbdb.cxx:1124
#37 0x00007ffff7a8379c in GB_write_pntr (gbd=0xc74a88, s=0xc55ca0 "/home/ralf/data/nas", bytes_size=20, stored_size=19) at arbdb.cxx:1277
#38 0x00007ffff7a838d6 in GB_write_string (gbd=0xc74a88, s=0xc55ca0 "/home/ralf/data/nas") at arbdb.cxx:1312
#39 0x00007ffff6ec7711 in AW_awar::write_string (this=0xc10180, para=0xc55ca0 "/home/ralf/data/nas") at AW_awar.cxx:144
#40 0x00007ffff6f12f48 in AW_scalar::write_to (this=0xc55c30, awar=0xc10180) at aw_scalar.cxx:31
#41 0x00007ffff6ecd58e in VarUpdateInfo::change_from_widget (this=0xc4e830, call_data=0x7fffffffd870) at AW_button.cxx:141
#42 0x00007ffff6ecd21b in AW_variable_update_callback (variable_update_struct=0xc4e830, call_data=0x7fffffffd870) at AW_button.cxx:76
#43 0x00007ffff655ac7f in XtCallCallbackList () from /usr/lib/libXt.so.6
#44 0x00007ffff6a88ae5 in ?? () from /usr/lib/libXm.so.3
#45 0x00007ffff6a8a8d7 in ?? () from /usr/lib/libXm.so.3
#46 0x00007ffff6587025 in XtCallActionProc () from /usr/lib/libXt.so.6
#47 0x00007ffff6591b2d in ?? () from /usr/lib/libXt.so.6
#48 0x00007ffff6591f6d in ?? () from /usr/lib/libXt.so.6
#49 0x00007ffff659251c in _XtTranslateEvent () from /usr/lib/libXt.so.6
#50 0x00007ffff6568f5b in XtDispatchEventToWidget () from /usr/lib/libXt.so.6
#51 0x00007ffff65697a3 in ?? () from /usr/lib/libXt.so.6
#52 0x00007ffff6568714 in XtDispatchEvent () from /usr/lib/libXt.so.6
#53 0x00007ffff65688bb in XtAppMainLoop () from /usr/lib/libXt.so.6
#54 0x00007ffff6ef5856 in AW_root::main_loop (this=0x9f3ce0) at AW_root.cxx:547
#55 0x0000000000513b50 in startup_gui (cl=..., error=...) at NT_main.cxx:870
#56 0x00000000005141ef in ARB_main (argc=3, argv=0x7fffffffe308) at NT_main.cxx:955
#57 0x00000000004f4a6f in main (argc=3, argv=0x7fffffffe308) at arb_main.cxx:10

comment:4 follow-up: Changed 10 years ago by epruesse

That's what I meant. Do you want to fix, or should I? (Forgot to assign to me… I was following it right now)

comment:5 follow-up: Changed 10 years ago by epruesse

And… do we go for a hotfix or do we move the concept of <awar_filebrowser_base>/name to hold the selected file name into AW_file.cxx? There seems to be duplication/similarity between MG_main.cxx:filename_changed_cb and NT_main.cxx:AWAR_DB_PATH_changed_cb

comment:6 in reply to: ↑ 5 Changed 10 years ago by westram

Replying to epruesse:

And… do we go for a hotfix or do we move the concept of <awar_filebrowser_base>/name to hold the selected file name into AW_file.cxx? There seems to be duplication/similarity between MG_main.cxx:filename_changed_cb and NT_main.cxx:AWAR_DB_PATH_changed_cb

It's very easy to break things concerned with filebrowsers, because of circular awar callbacks - so i wouldn't fiddle to much, at least not b4 arb6

comment:7 in reply to: ↑ 4 Changed 10 years ago by westram

Replying to epruesse:

That's what I meant. Do you want to fix, or should I? (Forgot to assign to me… I was following it right now)

me2 - let's compare solutions and decide then :)

comment:8 Changed 10 years ago by westram

===================================================================
--- MERGE/MG_main.cxx	(revision 11809)
+++ MERGE/MG_main.cxx	(working copy)
@@ -393,13 +393,14 @@ inline const char *get_awar_name(const c
 }
 
 static void filename_changed_cb(AW_root *awr, const char *awar_base_name) {
-    AW_awar *name_awar     = awr->awar(get_awar_name(awar_base_name, "name"));
     AW_awar *filename_awar = awr->awar(get_awar_name(awar_base_name, "file_name"));
 
     char *name;
     char *suffix;
     GB_split_full_path(filename_awar->read_char_pntr(), NULL, NULL, &name, &suffix);
 
+    if (name) {
+        AW_awar    *name_awar = awr->awar(get_awar_name(awar_base_name, "name"));
     const char *shown_name;
     if (strcmp(name, ":") == 0 && !suffix) {
         shown_name = ": (DB loaded in ARB_NT)";
@@ -408,6 +409,7 @@ static void filename_changed_cb(AW_root 
         shown_name = GB_append_suffix(name, suffix);
     }
     name_awar->write_string(shown_name);
+    }
 
     free(name);
     free(suffix);

comment:9 Changed 10 years ago by westram

  • Description modified (diff)

comment:10 follow-up: Changed 10 years ago by epruesse

I had the same, just w/o moving name_awar into the if clause.

Commit and forget. I'll create a file-browser refactor ticket.

(Although I am curious as to how this bug came about…)

comment:11 in reply to: ↑ 10 Changed 10 years ago by westram

  • Resolution set to fixed
  • Status changed from assigned to closed

by [11810]

Replying to epruesse:

Commit and forget. I'll create a file-browser refactor ticket. (Although I am curious as to how this bug came about…)

File browser has several awars (filename, directory, fullpath, suffix) which influence each other. This results in intermediate invalid states.

comment:12 Changed 10 years ago by epruesse

See also #491

Note: See TracTickets for help on using tickets.