View Issue Details

IDProjectCategoryView StatusLast Update
0031682FPCPackagespublic2017-04-21 21:26
ReporterC WesternAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0031682: simpleipc crash
DescriptionThe pair of simpleipc test programs crash on Mac OSX at least because of the use of an uninitialized lock. The attached patch should fix this.
Tagspatch
Fixed in Revision35879
FPCOldBugId
FPCTarget
Attached Files
  • ipc.patch (559 bytes)
    diff -uNr --exclude=.svn --exclude='*.rst' --exclude='*.fpm' trunk/fpcsrc/packages/fcl-process/src/simpleipc.pp trunk.w/fpcsrc/packages/fcl-process/src/simpleipc.pp
    --- trunk/fpcsrc/packages/fcl-process/src/simpleipc.pp	2017-04-18 21:27:15.000000000 +0100
    +++ trunk.w/fpcsrc/packages/fcl-process/src/simpleipc.pp	2017-04-19 15:46:16.000000000 +0100
    @@ -653,7 +653,8 @@
       try
         MsgItem:=FQueue.Pop;
       finally
    -    LeaveCriticalsection(FLock);
    +    if DoLock then
    +      LeaveCriticalsection(FLock);
       end;
       Result:=Assigned(MsgItem);
       if Result then
    
    ipc.patch (559 bytes)
  • simpleipc.pp.patch (444 bytes)
    Index: packages/fcl-process/src/simpleipc.pp
    ===================================================================
    --- packages/fcl-process/src/simpleipc.pp	(revision 35860)
    +++ packages/fcl-process/src/simpleipc.pp	(working copy)
    @@ -653,7 +653,8 @@
       try
         MsgItem:=FQueue.Pop;
       finally
    -    LeaveCriticalsection(FLock);
    +    if DoLock then
    +      LeaveCriticalsection(FLock);
       end;
       Result:=Assigned(MsgItem);
       if Result then
    
    simpleipc.pp.patch (444 bytes)

Activities

C Western

2017-04-19 22:38

reporter  

ipc.patch (559 bytes)
diff -uNr --exclude=.svn --exclude='*.rst' --exclude='*.fpm' trunk/fpcsrc/packages/fcl-process/src/simpleipc.pp trunk.w/fpcsrc/packages/fcl-process/src/simpleipc.pp
--- trunk/fpcsrc/packages/fcl-process/src/simpleipc.pp	2017-04-18 21:27:15.000000000 +0100
+++ trunk.w/fpcsrc/packages/fcl-process/src/simpleipc.pp	2017-04-19 15:46:16.000000000 +0100
@@ -653,7 +653,8 @@
   try
     MsgItem:=FQueue.Pop;
   finally
-    LeaveCriticalsection(FLock);
+    if DoLock then
+      LeaveCriticalsection(FLock);
   end;
   Result:=Assigned(MsgItem);
   if Result then
ipc.patch (559 bytes)

Cyrax

2017-04-20 16:37

reporter   ~0099704

Can you give us a proper patch?

See this wiki article for pointers : http://wiki.lazarus.freepascal.org/Creating_A_Patch

C Western

2017-04-20 17:21

reporter   ~0099706

Please be more specific about what is wrong with the patch - it applies fine to the current trunk.

Cyrax

2017-04-20 17:39

reporter   ~0099708

See my bugreport for an example : http://bugs.freepascal.org/view.php?id=29944

Proper header (with revision number, if you are working with SVN version control) is needed.

Index: components/codetools/keywordfunclists.pas
===================================================================
--- components/codetools/keywordfunclists.pas	(revision 52099)
+++ components/codetools/keywordfunclists.pas	(working copy)

Denis Kozlov

2017-04-20 17:43

reporter  

simpleipc.pp.patch (444 bytes)
Index: packages/fcl-process/src/simpleipc.pp
===================================================================
--- packages/fcl-process/src/simpleipc.pp	(revision 35860)
+++ packages/fcl-process/src/simpleipc.pp	(working copy)
@@ -653,7 +653,8 @@
   try
     MsgItem:=FQueue.Pop;
   finally
-    LeaveCriticalsection(FLock);
+    if DoLock then
+      LeaveCriticalsection(FLock);
   end;
   Result:=Assigned(MsgItem);
   if Result then
simpleipc.pp.patch (444 bytes)

Denis Kozlov

2017-04-20 17:44

reporter   ~0099709

A clean patch attached with the same effect as patch from the reporter.

> simpleipc.pp.patch [^] (444 bytes)

Michael Van Canneyt

2017-04-21 21:26

administrator   ~0099743

Applied the patch, thank you very much!

Issue History

Date Modified Username Field Change
2017-04-19 22:38 C Western New Issue
2017-04-19 22:38 C Western File Added: ipc.patch
2017-04-20 16:30 Denis Kozlov Tag Attached: patch
2017-04-20 16:37 Cyrax Note Added: 0099704
2017-04-20 17:21 C Western Note Added: 0099706
2017-04-20 17:39 Cyrax Note Added: 0099708
2017-04-20 17:43 Denis Kozlov File Added: simpleipc.pp.patch
2017-04-20 17:44 Denis Kozlov Note Added: 0099709
2017-04-21 21:14 Michael Van Canneyt Assigned To => Michael Van Canneyt
2017-04-21 21:14 Michael Van Canneyt Status new => assigned
2017-04-21 21:26 Michael Van Canneyt Fixed in Revision => 35879
2017-04-21 21:26 Michael Van Canneyt Note Added: 0099743
2017-04-21 21:26 Michael Van Canneyt Status assigned => resolved
2017-04-21 21:26 Michael Van Canneyt Fixed in Version => 3.1.1
2017-04-21 21:26 Michael Van Canneyt Resolution open => fixed
2017-04-21 21:26 Michael Van Canneyt Target Version => 3.2.0