It is currently Fri Dec 13, 2019 1:59 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: [Done] 5.44,5.60 Broken async http procedures?
PostPosted: Wed Apr 26, 2017 4:54 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jan 12, 2011 3:48 pm
Posts: 184
Location: Serbia
Try this code (taken from documentation):
Code:
InitNetwork()

Download = ReceiveHTTPMemory("http://www.purebasic.com/download/OgreAssimpConverter.zip", #PB_HTTP_Asynchronous)
If Download
  Repeat
    Progress = HTTPProgress(Download)
    Select Progress
      Case #PB_Http_Success
        *Buffer = FinishHTTP(Download)
        Debug "Download finished (size: " + MemorySize(*Buffer) + ")"
        FreeMemory(*Buffer)
        End
       
      Case #PB_Http_Failed
        Debug "Download failed"
        End
       
      Case #PB_Http_Aborted
        Debug "Download aborted"
        End
       
      Default
        Debug "Current download: " + Progress
       
    EndSelect
   
    Delay(500) ; Don't stole the whole CPU
  ForEver
Else
  Debug "Download error"
EndIf


It's crashing in PB 5.44 on Sierra.
Unicode mode, threadsafe flag and debugger don't do anything.
Can anyone confirm?

UPD: 5.60 does the same.

_________________
PB examples collection
pb-osx-globalhotkeys
pb-osx-notifications


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.44,5.60] Broken async http procedures?
PostPosted: Sun Apr 30, 2017 10:42 am 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 2063
Location: Germany
Confirmed on X64. X86 works

MacOS: 10.12.4; Xcode: 8.3.2 <-

Illegal instruction...
Quote:
Process: PureBasic.1 [26040]
Path: /tmp/PureBasic.1.app/Contents/MacOS/PureBasic.1
Identifier: PureBasic.1
Version: 0.1
Code Type: X86-64 (Native)
Parent Process: PureBasic [25943]
Responsible: PureBasic.1 [26040]
User ID: 501

Date/Time: 2017-04-30 11:38:32.220 +0200
OS Version: Mac OS X 10.12.4 (16E195)
Report Version: 12
Anonymous UUID: F80D58C7-3D21-A61C-02A4-A3DF4F654895

Sleep/Wake UUID: 7D50BE50-A18B-4B1B-8498-38D26AD4FF1C

Time Awake Since Boot: 700000 seconds
Time Since Wake: 3200 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXC_CRASH (SIGILL)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: PureBasic.1 [26040]

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x00007fff9159cf46 __semwait_signal + 10
1 libsystem_c.dylib 0x00007fff91523b72 nanosleep + 199
2 PureBasic.1 0x0000000100038547 PB_Delay + 71
3 PureBasic.1 0x00000001000019e7 EndSelect1 + 61

Thread 1:
0 libsystem_kernel.dylib 0x00007fff9159d44e __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff91687695 _pthread_wqthread + 1426
2 libsystem_pthread.dylib 0x00007fff916870f1 start_wqthread + 13

Thread 2:
0 libsystem_kernel.dylib 0x00007fff9159d44e __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff91687695 _pthread_wqthread + 1426
2 libsystem_pthread.dylib 0x00007fff916870f1 start_wqthread + 13

Thread 3:
0 libsystem_kernel.dylib 0x00007fff9159d44e __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff91687502 _pthread_wqthread + 1023
2 libsystem_pthread.dylib 0x00007fff916870f1 start_wqthread + 13

Thread 4:
0 libsystem_kernel.dylib 0x00007fff9159d44e __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff91687502 _pthread_wqthread + 1023
2 libsystem_pthread.dylib 0x00007fff916870f1 start_wqthread + 13

Thread 5:
0 libsystem_kernel.dylib 0x00007fff9159cdc6 __read_nocancel + 10
1 libsystem_c.dylib 0x00007fff914e815c _sread + 16
2 libsystem_c.dylib 0x00007fff914e7797 __srefill1 + 24
3 libsystem_c.dylib 0x00007fff914e248c __fread + 245
4 libsystem_c.dylib 0x00007fff914e2380 fread + 48
5 PureBasic.1 0x000000010002441a ExternalDebugger_CommunicationsThread + 106
6 libsystem_pthread.dylib 0x00007fff916879af _pthread_body + 180
7 libsystem_pthread.dylib 0x00007fff916878fb _pthread_start + 286
8 libsystem_pthread.dylib 0x00007fff91687101 thread_start + 13

Thread 6:
0 libsystem_kernel.dylib 0x00007fff9159cf46 __semwait_signal + 10
1 libsystem_c.dylib 0x00007fff91523b72 nanosleep + 199
2 PureBasic.1 0x000000010000e9a0 ExternalDebugger_WatchListThread + 80
3 libsystem_pthread.dylib 0x00007fff916879af _pthread_body + 180
4 libsystem_pthread.dylib 0x00007fff916878fb _pthread_start + 286
5 libsystem_pthread.dylib 0x00007fff91687101 thread_start + 13

Thread 7:
0 libsystem_malloc.dylib 0x00007fff915f1778 tiny_malloc_from_free_list + 8
1 libsystem_malloc.dylib 0x00007fff915f0472 szone_malloc_should_clear + 400
2 libsystem_malloc.dylib 0x00007fff915f243e malloc_zone_calloc + 87
3 libsystem_malloc.dylib 0x00007fff915f2d7f calloc + 30
4 libobjc.A.dylib 0x00007fff90b7ee4f class_createInstance + 88
5 libdispatch.dylib 0x00007fff9143876b _os_object_alloc_realized + 35
6 libdispatch.dylib 0x00007fff914387f3 dispatch_data_create_alloc + 36
7 libxpc.dylib 0x00007fff916b93e5 xpc_data_create + 46
8 libxpc.dylib 0x00007fff916c22d9 xpc_dictionary_set_data + 27
9 libsystem_network.dylib 0x00007fff91614701 nw_network_agent_copy_dictionary_from_necp + 126
10 libsystem_network.dylib 0x00007fff9163c792 nw_path_snapshot_path + 661
11 libsystem_network.dylib 0x00007fff9163c3d2 nw_path_create_evaluator_for_endpoint + 1233
12 libsystem_info.dylib 0x00007fff9155e751 si_addrinfo + 3027
13 libsystem_info.dylib 0x00007fff9155dad7 getaddrinfo + 185
14 PureBasic.1 0x0000000100040724 Curl_getaddrinfo_ex + 36
15 PureBasic.1 0x0000000100049fc9 Curl_getaddrinfo + 345
16 PureBasic.1 0x0000000100049673 Curl_resolv + 179
17 PureBasic.1 0x000000010004983f Curl_resolv_timeout + 319
18 PureBasic.1 0x00000001000670b2 Curl_connect + 11218
19 PureBasic.1 0x0000000100053d59 multi_runsingle + 249
20 PureBasic.1 0x0000000100053bbd curl_multi_perform + 173
21 PureBasic.1 0x000000010004558c curl_easy_perform + 364
22 PureBasic.1 0x000000010002586e RecieveHTTPMemory + 302
23 PureBasic.1 0x0000000100025739 Thread + 9
24 libsystem_pthread.dylib 0x00007fff916879af _pthread_body + 180
25 libsystem_pthread.dylib 0x00007fff916878fb _pthread_start + 286
26 libsystem_pthread.dylib 0x00007fff91687101 thread_start + 13

Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000004 rbx: 0x0000000000000000 rcx: 0x00007fff5fbffaf8 rdx: 0x0000000000000001
rdi: 0x0000000000000903 rsi: 0x0000000000000000 rbp: 0x00007fff5fbffb30 rsp: 0x00007fff5fbffaf8
r8: 0x0000000000000000 r9: 0x0000000005f5e100 r10: 0x0000000000000001 r11: 0x0000000000000246
r12: 0x0000000000000000 r13: 0x0000000000000000 r14: 0x00007fff5fbffb40 r15: 0x00007fff5fbffb40
rip: 0x00007fff9159cf46 rfl: 0x0000000000000247 cr2: 0x0000000100038500

Logical CPU: 0
Error Code: 0x0200014e
Trap Number: 133

_________________
My Projects ThreadToGUI / OOP-BaseClass / OOP-BaseClassDispatch / EventDesigner V3
PB v3.30 / v5.70 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.44,5.60] Broken async http procedures?
PostPosted: Mon May 01, 2017 1:16 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jan 12, 2011 3:48 pm
Posts: 184
Location: Serbia
Nice catch!
Yes, it works fine in 32-bit version.

_________________
PB examples collection
pb-osx-globalhotkeys
pb-osx-notifications


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.44,5.60] Broken async http procedures?
PostPosted: Thu May 04, 2017 5:56 pm 
Offline
Addict
Addict

Joined: Mon Aug 04, 2008 10:56 pm
Posts: 1108
Location: Seattle, USA
Yeah, I'm having problems too. This simple code works fine if I use the PB URL but doesn't work with these URL's that I have been using for quite a while. It just hangs after the file prompt.

Doesn't work for me in 5.60x64 final, 5.60b7x64 or 5.60b4x64.

Works fine in 5.51x64

Code:
InitNetwork()

  Filename$ = SaveFileRequester("Where to save index.php ?", "", "", 0)

  ;If ReceiveHTTPFile("http://www.purebasic.com/index.php", Filename$) ; https://finance.yahoo.com/quote/TSLA?ltr=1
  ;If ReceiveHTTPFile("https://www.finance.yahoo.com/quote/TSLA?ltr=1", Filename$) ; https://finance.yahoo.com/quote/TSLA?ltr=1
  If ReceiveHTTPFile("http://finance.yahoo.com/q?s=TSLA", Filename$) ; https://finance.yahoo.com/quote/TSLA?ltr=1
    Debug "Success"
  Else
    Debug "Failed"
  EndIf

_________________
MacBook Pro-r, OSX 10.14.6 , PB 5.70LTS


Top
 Profile  
Reply with quote  
 Post subject: Re: [5.44,5.60] Broken async http procedures?
PostPosted: Fri Apr 26, 2019 4:48 pm 
Online
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13660
Location: France
Fixed.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye