Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
188 user(s) are online (175 user(s) are browsing Forums)

Members: 0
Guests: 188

more...

Support us!

Headlines

 
  Register To Post  

Wait() returns -1 [SOLVED]
Just can't stay away
Just can't stay away


See User information
Working on GDB, I discover that IExec->Wait() often returns
-1. The docs say nothing about error conditions, so what could
this possibly mean?

This is the line:

sig = IExec->Wait(SIGBREAKF_CTRL_C|SIGBREAK_CTRL_D|1<<msgport->mp_SigBit);

EDIT: Byt the way, the port _has_ been created, and the sigbit is set.


Edited by alfkil on 2010/5/12 16:57:45
Go to top
Re: Wait() returns -1
Home away from home
Home away from home


See User information
@alfkil

Sorry for offtopic, but did you work on new/bug free version of GDB ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Wait() returns -1
Just can't stay away
Just can't stay away


See User information
@kas1e

I'm just fooling around. I managed to compile it and
fix a bug that made it crash every time it loaded some
code, but apart from that there's not so much progress.

Go to top
Re: Wait() returns -1
Home away from home
Home away from home


See User information
@alfkil

Can upload it somethere ?

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Wait() returns -1
Not too shy to talk
Not too shy to talk


See User information
@alfkil

Hmmm... Are you sure it's not returning a -1 when there's a message already waiting when it's called, and a 0 when not? Or something along those lines?

Go to top
Re: Wait() returns -1
Just can't stay away
Just can't stay away


See User information
@Daedalus

It should return the signal it receives. That is, if it receives SIGBREAKF_CTRL_C, then it returns that, if it receives a signal from the port, it returns a field with just the ports signal bit set. That's how it works in my test app, and that's how the docs describe it. Only place it doesn't work is in GDB. Strange...

Go to top
Re: Wait() returns -1
Quite a regular
Quite a regular


See User information
@alfkil

On the other end the doc says Wait() is returning an ULONG (uint32) how comes you are getting -1 ?

Back to a quiet home... At last
Go to top
Re: Wait() returns -1
Quite a regular
Quite a regular


See User information
@alfkil

The Wait() will return ALL the signal bits that are currently set, so in theory could have any number of bits set (up to 0xFFFFFFFF).

The -1 value is often used to signal an invalid signal bit number. The signal bit number can be anything from [0:31], and -1 is used in some calls (eg AllocSignal() to show failure. I wonder if the signal bit in your MsgPort has become corrupted, or perhaps the MsgPort has been deleted?

cheers
tony
Go to top
Re: Wait() returns -1
Just can't stay away
Just can't stay away


See User information
My sources can be downloaded at

http://dl.dropbox.com/u/5482530/gdb.lha

(in a few minutes). I didn't take the time to
organize it, so it is filled with .o files, .svn stuff
and a lot of other crap.

@tonyw:

I was thinking the same thing, that the port was
deleted, but why am I able to receive an actual
message from it a little later on?

Go to top
Re: Wait() returns -1
Just can't stay away
Just can't stay away


See User information
@alfkil

Quote:

sig = IExec->Wait(SIGBREAKF_CTRL_C|SIGBREAK_CTRL_D|1<<msgport->mp_SigBit);


First of all that should be SIGBREAKF_CTRL_D and not SIGBREAK_CTRL_D. Also I suggest putting a parenthesis around "1<<msgport->mp_SigBit" as this will if nothing else make your code much more readable (I don't remember what the relative precedences of bitwise or and shifting are in C so I can't say if not having a parenthesis will cause the wrong value to be calculated or not).

As tonyw says 0xffffffff is a valid return value from IExec->Wait() and would mean that all the task's 32 signals have been set. Maybe this is what happened?

Also you haven't posted the code that you use to display the return value from IExec->Wait(). Maybe there is a bug there?

Go to top
Re: Wait() returns -1
Just can't stay away
Just can't stay away


See User information
@salass00

Yeah, checking printouts is a good idea, and you
happen to be spot on... I must have been asleep
writing it... Doh!

Go to top
Re: Wait() returns -1
Quite a regular
Quite a regular


See User information
@alfkil

you have a PM you didn't noticed for the last 6 days...

Back to a quiet home... At last
Go to top
Re: Wait() returns -1
Just can't stay away
Just can't stay away


See User information
@abalaban

I finally got around to reply

Go to top
Re: Wait() returns -1
Just popping in
Just popping in


See User information
@alfkil

Quote:

alfkil wrote:
My sources can be downloaded at

http://dl.dropbox.com/u/5482530/gdb.lha


Oops! (404)
We can't find the page you're looking for. Check out our FAQ or forums for help. Or maybe you should try heading home.

:(

Go to top
Re: Wait() returns -1
Quite a regular
Quite a regular


See User information
@billt

are you wanting only a binary or the whole sources ?
Anyway MickJT have both and binary archive is online and directly downloadable, while for the source archive you must PM him.
All you need is in this thread : http://www.amigans.net/modules/newbb/ ... t_id=56044#forumpost56044

Back to a quiet home... At last
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project