@@ -62,6 +62,7 @@ def execute_script(script_source, is_file, is_launcher, is_graphical):
6262 traceback .print_exception (type (e ), e , tb )
6363
6464# Run the script in a new thread:
65+ # TODO: check if the script exists here instead of launching a new thread?
6566def execute_script_new_thread (scriptname , is_file , is_launcher , is_graphical ):
6667 print (f"main.py: execute_script_new_thread({ scriptname } ,{ is_file } ,{ is_launcher } )" )
6768 try :
@@ -70,8 +71,18 @@ def execute_script_new_thread(scriptname, is_file, is_launcher, is_graphical):
7071 # 16KB allows for 10 threads in the apps, but seems too tight for urequests on unix (desktop) targets
7172 # 32KB seems better for the camera, but it forced me to lower other app threads from 16 to 12KB
7273 #_thread.stack_size(24576) # causes camera issue...
73- #_thread.stack_size(16384)
74- _thread .stack_size (32 * 1024 )
74+
75+ if "camtest" in scriptname :
76+ print ("Starting camera with extra stack size!" )
77+ stack = 32 * 1024
78+ else :
79+ print ("\n \n \n WHAAAAAAAAAAAAAAAAAA\n \n \n " )
80+ #stack=16*1024 # somehow, on desktop, this causes a segfault... but the code isn't executed even!!!
81+ # [DEBUG 471155623] Connecting to wss://relay.damus.io
82+ # [DEBUG 471155623] Using SSL with no certificate verification
83+ stack = 32 * 1024
84+ _thread .stack_size (stack )
85+ print (f"app.py set stack size to { stack } " )
7586 _thread .start_new_thread (execute_script , (scriptname , is_file , is_launcher , is_graphical ))
7687 except Exception as e :
7788 print ("main.py: execute_script_new_thread(): error starting new thread thread: " , e )
@@ -169,11 +180,11 @@ def auto_connect():
169180 try :
170181 stat = uos .stat (custom_auto_connect )
171182 execute_script_new_thread (custom_auto_connect , True , False , False )
172- except OSError :
183+ except Exception as e :
173184 try :
174- print (f"Couldn't execute { custom_auto_connect } , trying { builtin_auto_connect } ..." )
185+ print (f"Couldn't execute { custom_auto_connect } because exception { e } , trying { builtin_auto_connect } ..." )
175186 stat = uos .stat (builtin_auto_connect )
176187 execute_script_new_thread (builtin_auto_connect , True , False , False )
177- except OSError :
178- print ("Couldn't execute {builtin_auto_connect}, continuing..." )
188+ except Exception as e :
189+ print ("Couldn't execute {builtin_auto_connect} because exception {e} , continuing..." )
179190
0 commit comments