gcad3d / gcad3d

parametric 3D CAD with viewer, import, export, NC.
http://www.gcad3d.org
Other
139 stars 34 forks source link

Crash, with any OBJ file. #52

Open pafurijaz opened 5 months ago

pafurijaz commented 5 months ago

Hi, as soon as I select the imported OBJ format model in the 3D view, the program closes immediately. The gCAD3D version used is the latest 2.60.06., that happen with any obj. untitled.zip

Greetings

gcad3d commented 5 months ago

hi, could import untitled.obj, viewing with no problems, and export it to dxf and load the dxf OK, using ubuntu 22 and ubu 20; executable was built on ubuntu 18. Do other models view OK ? What os do you use and which grafic card ? Greetings

pafurijaz commented 5 months ago

The step are these: Opening, then all is OK but when I click on it in the view port to select it gCAD crashed.

this is what I get from output in the console:

 ex-AP_impTyp_get 1
AP_kex_exec |xa_obj_r|gCad_main| mode=16
 DLL_LOAD_only |/usr/lib/gcad3d/Linux_x86_64//xa_obj_r.so|
 DLL_CONNECT  |gCad_main|
gCad_main-xa_obj_ut.c
ex-plugin-obj-imp 0
 ex-AP_kex_exec 0
*** stack smashing detected ***: terminated
Aborted (core dumped)

And this is the consloe output when I start gcad3d

+++++++++++++ Start  gCAD3D Version 2.60.06 2024/06/29-20:31:47
arg[0]|/usr/lib/gcad3d/Linux_x86_64//gCAD3D|
size int:4 long:8 ptr:8
Linux64
Linux sroot-Legion-5-15ACH6H 6.5.0-41-generic #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun  3 11:32:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Linux version 6.5.0-41-generic (buildd@lcy02-amd64-120) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun  3 11:32:55 UTC 2
GNU_LIBC_VERSION = |glibc 2.35|
GTK_MAJOR_VERSION=2 GTK_MINOR_VERSION=24
 ex-OS_bin_dir_set |/usr/lib/gcad3d/Linux_x86_64//|
AP_get_dir__ 
- AP_bas_dir = /usr/share/gcad3d/
- AP_loc_dir = /home/sroot/gCAD3D/
- AP_tmp_dir = /home/sroot/gCAD3D/tmp/
- AP_cfg_dir = /home/sroot/gCAD3D/cfg_Linux/
- AP_doc_dir = /usr/share/gcad3d/doc/
- AP_ico_dir = /usr/share/gcad3d/icons/
 lng[0] de
 lng[1] es
 lng[2] ms
 lng[3] en
 lng[4] fr
 lng[5] it
Debug-switch DDEB is ON
 test configfile |/home/sroot/gCAD3D/cfg_Linux/gCAD3D.rc|
 L_startup_defaults:
OS_get_scrRes 3840 1080
AP_defaults_read |/home/sroot/gCAD3D/cfg_Linux/xa.rc|
 AP_mod_dir=|/home/sroot/Documenti/CAD/iges/|
 AP_lang=|it|
 OS_browser=|firefox|
 AP_printer=|lpr -l -PStylus-DX7000F|
 AP_dir_prg=|/home/sroot/gCAD3D/prg/|
 active application=|| 4
 AP_editor=|//|
 AP_winSiz=|-1920,-1034|
 DefaultModelsize=500.000000
AP_defaults_read-AP_winPos |-5,-5|
 AP_winPos=|-5,-5|
MSG_const_init |it|
OMN_init 
AP_DllLst_write 
PRC_lst_processors 
::::DL_alloc__ 10000 320000
GUI_Init__ ||
 f-gtk_init
GTK_MAJOR_VERSION=2 GTK_MINOR_VERSION=24
Ico_init 
 GUI_Ico_init-icoNr=20
UI_fontsizX/Y=6,18
 lang-activate |it|
UI_lang_chg |de|it| 0
UI_lang_chg |it|it| 0
MSG_const_init |it|
 men_hlp-L31
UI_Set_typPrg 4
GL_RENDERER:    (null)
GL_VERSION:     (null)
GL_EXTENSIONS:  (null)
GLU_VERSION:    1.3
GLU_EXTENSIONS: GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess 
GUI_msgwin__ |e,e|
 win_resize-|-1920,-1034| 1920 1034
OS_dev_ck 
OS_dev_ck 1
MSG_const_init |it|
 ex-GUI_get_version gtk 2 24
::::UTF_alloc__ 100 0 0
 reall > 2000004
ex-UTF_alloc__ 
GL_Init__ mode=0 1715 786
GL_InitInfo
GL_RENDERER:    RENOIR (renoir, LLVM 15.0.7, DRM 3.54, 6.5.0-41-generic)
GL_VERSION:     4.6 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
GLU_VERSION:    1.3
GLU_EXTENSIONS: GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess 
 GL_DEPTH_BITS = 24
 GL_STENCIL_BITS = 0
 GL_ACCUM_RED/GREEN/BLUE/ALPHA_BITS = 0 0 0 0
 GL_RED/GREEN/BLUE/ALPHA_BITS = 8 8 8 0
 AP_stat.texture=1
 GL_Init0
::::GLT_alloc_pta 3 0 25000 25000
::::GLT_alloc_cta 1 0 10000 10000
::::GLT_alloc_ppa 1 0 6000 6000
::::GLU_alloc 1 0 400 400
::::DB_allocModRef 0 0 200 200
UI_PRI_unl AP_stat.fVwr = 0
::::DB_allocCDAT 0 2000000
::::DB_allocLine 0 0 5000 5000
GL_selTab_init 0
Brw_init__ 1
AP_tmr_init ............ 
UI_VWR_ON 0
::::UTF_alloc__ 426 2000000 0
 init pipes ..

My OS is Ubuntu 22.04 LTS With NVIDIA GTX 3070

Greetings

gcad3d commented 5 months ago

Hi,

pafurijaz commented 5 months ago

Hi, is the same.

+++++++++++++ Start  gCAD3D Version 2.60.06 2024/06/30-11:47:12
arg[0]|/usr/lib/gcad3d/Linux_x86_64//gCAD3D|
size int:4 long:8 ptr:8
Linux64
Linux sroot-Legion-5-15ACH6H 6.5.0-41-generic #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun  3 11:32:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Linux version 6.5.0-41-generic (buildd@lcy02-amd64-120) (x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun  3 11:32:55 UTC 2
GNU_LIBC_VERSION = |glibc 2.35|
GTK_MAJOR_VERSION=2 GTK_MINOR_VERSION=24
 ex-OS_bin_dir_set |/usr/lib/gcad3d/Linux_x86_64//|
AP_get_dir__ 
- AP_bas_dir = /usr/share/gcad3d/
- AP_loc_dir = /home/sroot/gCAD3D/
- AP_tmp_dir = /home/sroot/gCAD3D/tmp/
- AP_cfg_dir = /home/sroot/gCAD3D/cfg_Linux/
- AP_doc_dir = /usr/share/gcad3d/doc/
- AP_ico_dir = /usr/share/gcad3d/icons/
 lng[0] de
 lng[1] es
 lng[2] ms
 lng[3] en
 lng[4] fr
 lng[5] it
Debug-switch DDEB is ON
 test configfile |/home/sroot/gCAD3D/cfg_Linux/gCAD3D.rc|
 L_startup_defaults:
OS_get_scrRes 1920 1080
AP_defaults_read |/home/sroot/gCAD3D/cfg_Linux/xa.rc|
 AP_mod_dir=|/home/sroot/Documenti/blend_files/Sample/Betty_B/Cilindro_batterie/|
 AP_lang=|it|
 OS_browser=|firefox|
 AP_printer=|lpr -l -PStylus-DX7000F|
 AP_dir_prg=|/home/sroot/gCAD3D/prg/|
 active application=|| 4
 AP_editor=|//|
 AP_winSiz=|-1920,-1034|
 DefaultModelsize=500.000000
AP_defaults_read-AP_winPos |-5,-5|
 AP_winPos=|-5,-5|
MSG_const_init |it|
OMN_init 
AP_DllLst_write 
PRC_lst_processors 
::::DL_alloc__ 10000 320000
GUI_Init__ ||
 f-gtk_init
GTK_MAJOR_VERSION=2 GTK_MINOR_VERSION=24
Ico_init 
 GUI_Ico_init-icoNr=20
UI_fontsizX/Y=6,18
 lang-activate |it|
UI_lang_chg |de|it| 0
UI_lang_chg |it|it| 0
MSG_const_init |it|
 men_hlp-L31
UI_Set_typPrg 4
GL_RENDERER:    (null)
GL_VERSION:     (null)
GL_EXTENSIONS:  (null)
GLU_VERSION:    1.3
GLU_EXTENSIONS: GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess 
GUI_msgwin__ |e,e|
 win_resize-|-1920,-1034| 1920 1034
OS_dev_ck 
OS_dev_ck 1
MSG_const_init |it|
 ex-GUI_get_version gtk 2 24
::::UTF_alloc__ 100 0 0
 reall > 2000004
ex-UTF_alloc__ 
GL_Init__ mode=0 1715 786
GL_InitInfo
GL_RENDERER:    NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2
GL_VERSION:     4.6.0 NVIDIA 535.183.01
GLU_VERSION:    1.3
GLU_EXTENSIONS: GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess 
 GL_DEPTH_BITS = 24
 GL_STENCIL_BITS = 8
 GL_ACCUM_RED/GREEN/BLUE/ALPHA_BITS = 16 16 16 16
 GL_RED/GREEN/BLUE/ALPHA_BITS = 8 8 8 0
 AP_stat.texture=1
 GL_Init0
::::GLT_alloc_pta 3 0 25000 25000
::::GLT_alloc_cta 1 0 10000 10000
::::GLT_alloc_ppa 1 0 6000 6000
::::GLU_alloc 1 0 400 400
::::DB_allocModRef 0 0 200 200
UI_PRI_unl AP_stat.fVwr = 0
::::DB_allocCDAT 0 2000000
::::DB_allocLine 0 0 5000 5000
GL_selTab_init 0
Brw_init__ 1
AP_tmr_init ............ 
UI_VWR_ON 0
::::UTF_alloc__ 426 2000000 0
 init pipes ..
UI_men__ |open|
UI_file_open__ |/home/sroot/Documenti/blend_files/clienti/Betty_Buoy/Cilindro_batterie/|
OS_exe_file__ |GUI_file|
OS_exe_file_fn |GUI_file|
 ex-GUI_get_version gtk 2 24
 ex-OS_exe_file_fn |/usr/lib/gcad3d/Linux_x86_64//GUI_file_gtk2|
 ex-GUI_file_in |/tmp/temp_1804289383_in|
***** start exe GUI_file V2.0 2
 ex-OS_bin_dir_set |/usr/lib/gcad3d/Linux_x86_64//|
 ex-GUI_file_out_in |/tmp/temp_1804289383_out|
 ex-GUI_file_out_in |/tmp/temp_1804289383_out|
UI_PRI_unl AP_stat.fVwr = 0
GL_selTab_init 0
Brw_init__ 2
AP_Mod_load_init |/home/sroot/Documenti/blend_files/export/untitled.obj|
MDL_load_main |/home/sroot/Documenti/blend_files/export/untitled.obj| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
UI_PRI_unl AP_stat.fVwr = 0
GL_selTab_init 0
Brw_init__ 2
 ex-AP_impTyp_get 1
MDL_load_noNat |/home/sroot/Documenti/blend_files/export/untitled.obj|_home_sroot_Documenti_blend_files_export_untitled_obj|
   _load_noNat-1 |_home_sroot_Documenti_blend_files_export_untitled_imp_obj|_home_sroot_Documenti_blend_files_export_untitled_imp_obj|
ex-MDL_load_noNat 0 symNam=|_home_sroot_Documenti_blend_files_export_untitled_imp_obj|_home_sroot_Documenti_blend_files_export_untitled_imp_obj|
MDL_load_import__ 13 |/home/sroot/Documenti/blend_files/export/untitled.obj|
 ex-AP_impTyp_get 1
::::UTF_alloc__ 485 2000000 0
Brw_init__ 2
Brw_Prcs_Init 
AP_Init2 1
MDL_load_import__ 13 |/home/sroot/Documenti/blend_files/export/untitled.obj|
 ex-AP_impTyp_get 1
AP_kex_exec |xa_obj_r|gCad_main| mode=16
 DLL_LOAD_only |/usr/lib/gcad3d/Linux_x86_64//xa_obj_r.so|
 DLL_CONNECT  |gCad_main|
gCad_main-xa_obj_ut.c
ex-plugin-obj-imp 0
 ex-AP_kex_exec 0
*** stack smashing detected ***: terminated
Aborted (core dumped)

Greetings

gcad3d commented 4 months ago

Hallo,

pafurijaz commented 4 months ago

STEP models are fine, the problem only happens with OBJ files, only if I interact with them in the window, until I click on them everything is OK, I can also export.

I downloaded the deb file from the site, I didn't compile it, but I can try to do it, I don't remember all the steps but I compiled it a few times in the past. So, now for a better debug, I've to compile by self?, This will require a while.

Greetings.

pafurijaz commented 4 months ago

Hi Franz, here an other issues that I don't understand, file as VRML 1 and 2 Saved with gCAD3D are impossible to open again with it while other application can import them without issues, but seem that isn't a supported format, I think in the previous gCAD3D was possible, or I'm wrong?

gcad3d commented 4 months ago

I could provide a version with debug=ON; maybe this would help to solve the problem ? For our big goal - the boolean operatons with bodies - many changes are necessary, and it will still take a long time. Not all export - import - modules are always up to date ..

pafurijaz commented 4 months ago

Of course it would be fine if you provide me with an executable version without installing from the directory, I understand that there aren't enough people, when you have time it would certainly be useful to understand what the problem could be.

Greetings

gcad3d commented 4 months ago

have placed a minimal version with obj input at: gcad3d.org/download/gcad_deb_V2_60_06.zip Hope this helps to find the problem .. Greetings

pafurijaz commented 4 months ago

Thanks I will do some test. :)

pafurijaz commented 4 months ago

Hi Franz, this is the output, and attached the a screenshot. Greetings.

*** stack smashing detected ***: terminated

Thread 1 "gCAD3D" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737326066176) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: File o directory non esistente.
(gdb) where
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737326066176) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737326066176) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737326066176, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff7642476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff76287f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff7689676 in __libc_message (action=action@entry=do_abort, 
    fmt=fmt@entry=0x7ffff77db92e "*** %s ***: terminated\n") at ../sysdeps/posix/libc_fatal.c:155
#6  0x00007ffff773659a in __GI___fortify_fail (msg=msg@entry=0x7ffff77db916 "stack smashing detected")
    at ./debug/fortify_fail.c:26
#7  0x00007ffff7736566 in __stack_chk_fail () at ./debug/stack_chk_fail.c:24
#8  0x00005555555d2822 in UI_GR_Select_work2 (typ=123, dbi=20, buf=0x555555811cc0 <GR_selNam> "M20", dli=1)
    at ../xa/xa_ui_gr.c:7323
#9  0x00005555555d2404 in UI_GR_Select_work1 (objInd=1) at ../xa/xa_ui_gr.c:6976
#10 0x00005555555d10e7 in UI_GR_Select2 (typ=123, dbi=20, dli=1) at ../xa/xa_ui_gr.c:4957
#11 0x00005555555cf6d1 in UI_GR_Select_selLst (isel=0) at ../xa/xa_ui_gr.c:3913
#12 0x00005555555cf1c1 in UI_popSel_CB__ (mo=0x555555e33e60, data=0x7fffffffcf20) at ../xa/xa_ui_gr.c:3611
#13 0x00007ffff7fae9bd in GUI_popup_cb1 (parent=0x555555e33e60, data=0xfffffffffffffffe) at ../gui_gtk2/gtk_multichoice.c:698
#14 0x00007ffff7fae831 in GUI_popup_cb2 (parent=0x555555e33e60, event=0x555556453910, data=0x0)
    at ../gui_gtk2/gtk_multichoice.c:623
#15 0x00007ffff7b434d7 in ?? () from /lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#16 0x00007ffff70b1d2f in g_closure_invoke () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#17 0x00007ffff70cdc36 in ?? () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#18 0x00007ffff70cf026 in g_signal_emit_valist () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#19 0x00007ffff70cf863 in g_signal_emit () from /lib/x86_64-linux-gnu/libgobject-2.0.so.0
#20 0x00007ffff7c6f024 in ?? () from /lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#21 0x00007ffff7b41094 in gtk_propagate_event () from /lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0
#22 0x00007ffff7b426db in gtk_main_do_event () from /lib/x86_64-linux-gnu/libgtk-x11-2.0.so.0

image

gcad3d commented 4 months ago

Have modified gCAD3D_gui_gtk2.so (func GUI_popup_cb2 modif. and testoutput). Please replace this file and test. Thanks for you help and greetings.

pafurijaz commented 4 months ago

Hi Franz I will try to re download again. Soon I answer again. Greetings

pafurijaz commented 4 months ago

Hi again, now the output is much less here the error:

Thread 1 "gCAD3D" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737326066176) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: File o directory non esistente.

Greetings

gcad3d commented 4 months ago

at the moment no idea what to do .. gcad does not use threads; so it must be in gtk2 or gl ..

pafurijaz commented 4 months ago

Hi Franz, it's only the OBJ file, which creates problems for me, I can interact and save all the others, I often use it to save DXF files from other files and to export to IGES, I try to understand what I can depend on, maybe I'll also try to compile gCAD3D myself, if I understand I will inform you.

Greetings

gcad3d commented 4 months ago

So: other plugins (xa*.so - files) seem to work ok (eg xa_dxf_r.so xa_ige_w.so). That means the problem is in xa_obj_r.so. I will check it and provide a debug-version of it. Greetings.

pafurijaz commented 4 months ago

Thanks :)

gcad3d commented 4 months ago

Have updated teh debug-file; please see README.debug. Greetings from Vienna.

pafurijaz commented 4 months ago

Hi Franz, seem to me the same that I've already reported with latest one however here, the full console output from the import.

MDL_load_noNat |/home/sroot/Documenti/CAD/boat/wrl/Viko_20_V_new.obj|_home_sroot_Documenti_CAD_boat_wrl_Viko_20_V_new_obj|
   _load_noNat-1 |_home_sroot_Documenti_CAD_boat_wrl_Viko_20_V_new_imp_obj|_home_sroot_Documenti_CAD_boat_wrl_Viko_20_V_new_imp_obj|
[Detaching after vfork from child process 176018]
ex-MDL_load_noNat 0 symNam=|_home_sroot_Documenti_CAD_boat_wrl_Viko_20_V_new_imp_obj|_home_sroot_Documenti_CAD_boat_wrl_Viko_20_V_new_imp_obj|
MDL_load_import__ 13 |/home/sroot/Documenti/CAD/boat/wrl/Viko_20_V_new.obj|
 ex-AP_impTyp_get 1
::::UTF_alloc__ 484 2000000 0
Brw_init__ 2
Brw_Prcs_Init 
AP_Init2 1
MDL_load_import__ 13 |/home/sroot/Documenti/CAD/boat/wrl/Viko_20_V_new.obj|
 ex-AP_impTyp_get 1
AP_kex_exec |xa_obj_r|gCad_main| mode=16
 DLL_LOAD_only |/usr/lib/gcad3d/Linux_x86_64/xa_obj_r.so|
 DLL_CONNECT  |gCad_main|
gCad_main-xa_obj_ut.c
ex-plugin-obj-imp 0
 ex-AP_kex_exec 0
UI_viewCB |ResView|
GUI_popup_cb2 ev=7
*** stack smashing detected ***: terminated

Thread 1 "gCAD3D" received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=140737326066176) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: File o directory non esistente.

Greetings

gcad3d commented 4 months ago

the 1. parameter (parent) of GUI_popup_cb2 seems to be KO. Until now we cannot find any vialation of the stack; valgrind cannot help. After import of obj; can you save the model - and later load ? What if you import obj, immediately export as dxf. Has dxf been written - can you load it ? Hard to find the problem if we cannot reproduce .. Greetings

pafurijaz commented 4 months ago

Hi Franz, I understand the difficulties, and regarding the problem with OBJ, if I save the files in DXF, there are no problems, but if I open these files and click on them, the same thing happens as with OBJ files, I am attaching a series of files created in this period if they can be useful, perhaps it is possible that with these you can reproduce the problem, otherwise leave it, and hope that things will be resolved in the future, when you have sorted out the work you are doing now . Testing_file.zip

Greetings

gcad3d commented 4 months ago

since we cannot reproduce the problem on all available Desktops and Laptops,

pafurijaz commented 4 months ago

OK Franz, don't worry about that, for now and until a new updated, I will avoid on clicking over OBJ files and thanks for your time. Greetings.

gcad3d commented 15 hours ago

Hallo, we fixed a bug causing a crash before activating the GUI with V2_60_06-2. Hope this caused your problem ..