flat assembler
Message board for the users of flat assembler.

Index > Projects and Ideas > Another FreshLib based project - phWeb server.

Goto page Previous  1, 2, 3
Author
Thread Post new topic Reply to topic
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 13 Dec 2015, 18:21
hidnplayr wrote:
Only problem noticed so far is stack corruption which results in page fault at address 0x4BE.


Well, yes, I know that, but I still can't find a way to free the dynamically allocated thread stack and then to still call the system function -1. If you know such a way, please, tell it to me. Smile With not free the stack (commenting out the lines 131..133 in "process.asm" the socket still hangs.

Also, the hanging problem is not related to the threads, because I tried the same code without creating threads, but the listening socket still hangs sometimes. You can try in as well, by changing:

Code:
; sockets asm, line 56
        stdcall ThreadCreate, ConnectionHandler, ebx    

into:
Code:
  stdcall ConnectionHandler, ebx    

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 13 Dec 2015, 18:21
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 13 Dec 2015, 20:57
@hidnplayr: I just commited some fix for Terminate procedure stack crash bug. Use "fossil update" in FreshLibDev directory in order to pull the fix.
Post 13 Dec 2015, 20:57
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
hidnplayr



Joined: 13 Dec 2015
Posts: 8
hidnplayr 14 Dec 2015, 07:27
JohnFound wrote:
Well, yes, I know that, but I still can't find a way to free the dynamically allocated thread stack and then to still call the system function -1. If you know such a way, please, tell it to me. Smile ]


The problem lies not in the system function call, but debug output, for which you use an stdcall.
Just print the text you want to print, before freeing memory Wink
Post 14 Dec 2015, 07:27
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 14 Dec 2015, 09:12
hidnplayr wrote:
The problem lies not in the system function call, but debug output, for which you use an stdcall.


Hm, am I missing something? IMHO, the int instruction needs stack as well. Or it uses the ring 0 stack?

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 14 Dec 2015, 09:12
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
hidnplayr



Joined: 13 Dec 2015
Posts: 8
hidnplayr 14 Dec 2015, 09:18
JohnFound wrote:
Hm, am I missing something? IMHO, the int instruction needs stack as well. Or it uses the ring 0 stack?

Yes
Post 14 Dec 2015, 09:18
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 14 Dec 2015, 11:01
So, another fix has been committed. Now I hope everything is OK. Smile
Post 14 Dec 2015, 11:01
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
hidnplayr



Joined: 13 Dec 2015
Posts: 8
hidnplayr 16 Dec 2015, 21:28
Some fixes have been made in KolibriOS kernel as well.
You will however still notice that memory to create a new socket is rapidly exhausted.
(Socket accept will return ENOMEM in ebx)

This may be fixed in a later revision.
Post 16 Dec 2015, 21:28
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 17 Dec 2015, 07:15
hidnplayr wrote:
(Socket accept will return ENOMEM in ebx)


Unfortunately, I can't see this happens. The thread that executes SocketAccept still hangs and can not be killed even from the task manager. SocketAccept does not return any error code.

I am testing with the latest rev.5979, downloaded from the download page of KolibriOS.

_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 17 Dec 2015, 07:15
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
eisbaer



Joined: 25 Nov 2012
Posts: 8
eisbaer 17 Dec 2015, 14:14
@johnfound:
would it be possible for you to upload
a windows-binary or a linux-binary based on the actual sourcecode
for testing purposes ?

best regards
Post 17 Dec 2015, 14:14
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 17 Dec 2015, 15:26
eisbaer wrote:
@johnfound:
would it be possible for you to upload
a windows-binary or a linux-binary based on the actual sourcecode
for testing purposes ?

best regards


No problem, but notice that it is work in progress and the source code can change quickly with the changes in FreshLib and/or phWeb. So, the attached binary is just a snapshot in this very moment.

The best way to follow the development is to clone the repositories (of phWeb and Fresh) and compile from sources. Compilation with FASM or Fresh IDE is possible and easy.

In the attached archive are all supported versions: For WIn32, Linux and KolibriOS, compiled from the source checkins:

FreshLib: 1f0438263ec5b31f10332dc2164a208f02cc7e4e
phWeb: 5e1458a965a0fe12f9badd000655114ed491f664


Description:
Download
Filename: phWeb.tar.gz
Filesize: 216.83 KB
Downloaded: 765 Time(s)


_________________
Tox ID: 48C0321ADDB2FE5F644BB5E3D58B0D58C35E5BCBC81D7CD333633FEDF1047914A534256478D9
Post 17 Dec 2015, 15:26
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
hidnplayr



Joined: 13 Dec 2015
Posts: 8
hidnplayr 17 Dec 2015, 16:27
JohnFound:
I have only tested on VirtualBox so far, I will check on Qemu and real hardware soon.
Post 17 Dec 2015, 16:27
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 17 Dec 2015, 19:55
Hm, is it possible to be from the emulator. Will test on real as well then and will report the result.
Post 17 Dec 2015, 19:55
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3

< Last Thread | Next Thread >
Forum Rules:
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
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.