We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1888 - Crash observed in SDL_PollEvent()
Summary: Crash observed in SDL_PollEvent()
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 1.3.0
Hardware: Other Windows 7
: P2 critical
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-04 00:31 UTC by Prerna
Modified: 2013-08-03 00:17 UTC (History)
0 users

See Also:


Attachments
Crash stack trace (31.78 KB, image/png)
2013-06-04 00:31 UTC, Prerna
Details
assert (60.58 KB, image/png)
2013-06-09 23:38 UTC, Prerna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Prerna 2013-06-04 00:31:17 UTC
Created attachment 1170 [details]
Crash stack trace

Hi,

I have an application on windows 7 that is used for making video call. When I make a video call and my application opens up the near end and far end video my application sometimes unexpectedly terminates at sdl_pollevent. By looking at the stack trace i dont see memory correuption and it seems like the loop is forever stuck in sdl_pollevent. I have attached the stack trace. Below is the code in opensource PJSIP library that is causing trouble:

static pj_status_t handle_event(void *data)
{
    struct sdl_factory *sf = (struct sdl_factory*)data;
    SDL_Event sevent;
	
    if (!pj_thread_is_registered())
	{
		pj_thread_register("sdl_ev", sf->thread_desc, &sf->ev_thread);
	}

    while (SDL_PollEvent(&sevent)) {
        struct sdl_stream *strm = NULL;
        pjmedia_event pevent;.......

Can someone give me pointers that can help me resolve this issue.
Comment 1 Prerna 2013-06-04 00:32:31 UTC
Also is there any means by which i can enable logs in SDL to help u debug further. I dont see any logs in SDL.dll right now. I am using version SDL-1.3.0-5536.
Comment 2 Prerna 2013-06-07 01:00:55 UTC
Any comments?
Comment 3 Sam Lantinga 2013-06-07 03:10:52 UTC
This might be fixed by a change in the latest snapshot:
http://www.libsdl.org/tmp/SDL-2.0.0-7295.zip

Can you try this out and let me know if this fixes it?
Comment 4 Prerna 2013-06-07 07:23:55 UTC
Sure. Thanks for the inputs. Let me try and ill update u on same.
Comment 5 Prerna 2013-06-09 23:38:22 UTC
Created attachment 1187 [details]
assert
Comment 6 Prerna 2013-06-09 23:39:04 UTC
Hi Sam,

I tried to use SDL provided by you but it gives me an assert as soon as I init my application. Please have a look and let me know how it can be resolved?

Due to this assert my video call crashes as soon as i answer the call. Please find the snapshot of assert attached. If i can resolve this I am sure the crash in video call would be automatically resolved as the crash is observed in function :

pjmedia_vid_dev_count()

Let me know your inputs!

Thanks,
Prerna
Comment 7 Prerna 2013-06-12 07:32:12 UTC
Hi Sam,

Request your input in this as it is blocking for me.

Thanks in advance,
Prerna Gupta
Comment 8 Sam Lantinga 2013-06-13 00:56:33 UTC
Sorry, I don't know anything about PJSIP or why it would assert there.  Can you contact the authors and let them know about your problem?
Comment 9 Prerna 2013-06-13 06:01:20 UTC
Hi Sam,

It was an issue at PJSIP side. They have just given the fix in following:

https://trac.pjsip.org/repos/ticket/1676.

I'll now test with this version of SDL and let u know about the crash.

Thanks,
Prerna
Comment 10 Prerna 2013-07-01 02:26:55 UTC
Hi Sam,

I am not able to use SDL 2.0 with PJSIP. I keep getting this error:

16:09:30.144      sdl_dev.c !SDL_Init() error: Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?

When i used SDL1.3 I did not include this header anywhere in my code and it worked for me. Not sure why such an error comes with SDL2.0. However i have already included "include path" and "Lib path" in my dependencies but still it does not work for me. Any idea what more can be done to avoid this?

Prerna
Comment 11 Sam Lantinga 2013-07-06 03:37:52 UTC
This should be fixed in the latest RC, can you check it out?
http://www.libsdl.org/tmp/download-2.0.php
Comment 12 Prerna 2013-08-02 02:17:02 UTC
Hi Sam,

I built my project with latest SDL2.0 and it works fine for me. I will have to do a round of testing to check if i observe crash again or not.

Thanks for your inputs.
Comment 13 Sam Lantinga 2013-08-03 00:17:21 UTC
Thanks!