Opened 8 years ago

Closed 7 years ago

#7235 closed bug (fixed)

JamVM thread continue to wait for signal when sent

Reported by: korli Owned by: nobody
Priority: normal Milestone: R1
Component: System/POSIX Version: R1/Development
Keywords: Cc:
Blocked By: #5679 Blocking:
Has a Patch: yes Platform: All

Description

When compiling Classpath, JamVM running Eclipse java compiler uses multiple threads, which are suspended and resumed by signals.

I tried to recreate the problem with src/tests/system/libroot/posix/pthread_signal_test.cpp, I hope I got it right. The test name is pthread_signal_test.

Attachments (1)

pthread.diff (1.6 KB) - added by korli 8 years ago.
init thread id so that it can be used by pthread_kill()

Download all attachments as: .zip

Change History (8)

comment:1 Changed 8 years ago by bonefish

Blocked By: 5679 added
Resolution: duplicate
Status: newclosed

Looks like a duplicate of #5679.

comment:2 Changed 8 years ago by korli

Resolution: duplicate
Status: closedreopened

#5679 is indeed a problem but not the only one met with JamVM. pthread_kill send signals to a thread which doesn't receive it, it's not killed either. send_signal() is actually called with a thread id 0.

To init the main thread id when calling pthread_self(), we have to init sMainThread correctly.

Last edited 8 years ago by korli (previous) (diff)

Changed 8 years ago by korli

Attachment: pthread.diff added

init thread id so that it can be used by pthread_kill()

comment:3 Changed 8 years ago by korli

Has a Patch: set

comment:4 Changed 8 years ago by bonefish

Looks OK. Apparently freeing the pthread_thread structure on error is missing in spawn_thread().

comment:5 Changed 8 years ago by korli

I applied with the structure freeing in hrev40665. I'll see if it's enough to close this report.

comment:6 Changed 8 years ago by bonefish

If it wasn't fixed before, please retry with hrev42116.

comment:7 Changed 7 years ago by bonefish

Resolution: fixed
Status: reopenedclosed

Assuming fixed. Please reopen, if not.

Note: See TracTickets for help on using tickets.