You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/11/04 17:49:14 UTC

[GitHub] [incubator-mxnet] leezu opened a new pull request #19475: Avoid segfault when calling __repr__ on ndarray or symbol with freed handle

leezu opened a new pull request #19475:
URL: https://github.com/apache/incubator-mxnet/pull/19475


   ## Description ##
   Fixes https://github.com/apache/incubator-mxnet/issues/19473


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] leezu commented on pull request #19475: Avoid segfault when calling __repr__ on ndarray or symbol with freed handle

Posted by GitBox <gi...@apache.org>.
leezu commented on pull request #19475:
URL: https://github.com/apache/incubator-mxnet/pull/19475#issuecomment-721965833


   @mxnet-bot run ci [unix-gpu]


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on a change in pull request #19475: Avoid segfault when calling __repr__ on ndarray or symbol with freed handle

Posted by GitBox <gi...@apache.org>.
szha commented on a change in pull request #19475:
URL: https://github.com/apache/incubator-mxnet/pull/19475#discussion_r517539714



##########
File path: python/mxnet/symbol/symbol.py
##########
@@ -73,12 +73,15 @@ def as_nd_ndarray(self):
 
     def __repr__(self):
         """Gets a string representation of the symbol."""
-        name = self.name
-        if name is None:
-            name = ', '.join([i.name for i in self])
-            return '<%s group [%s]>' % (self.__class__.__name__, name)
+        if self._alive:
+            name = self.name
+            if name is None:
+                name = ', '.join([i.name for i in self])
+                return '<%s group [%s]>' % (self.__class__.__name__, name)
+            else:
+                return '<%s %s>' % (self.__class__.__name__, name)
         else:
-            return '<%s %s>' % (self.__class__.__name__, name)
+            return 'FREED Symbol'

Review comment:
       ```suggestion
               return '<FREED {}>'.format(self.__class__.__name__)
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #19475: Avoid segfault when calling __repr__ on ndarray or symbol with freed handle

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #19475:
URL: https://github.com/apache/incubator-mxnet/pull/19475#issuecomment-721965886


   Jenkins CI successfully triggered : [unix-gpu]


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] mxnet-bot commented on pull request #19475: Avoid segfault when calling __repr__ on ndarray or symbol with freed handle

Posted by GitBox <gi...@apache.org>.
mxnet-bot commented on pull request #19475:
URL: https://github.com/apache/incubator-mxnet/pull/19475#issuecomment-721879967


   Hey @leezu , Thanks for submitting the PR 
   All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands: 
   - To trigger all jobs: @mxnet-bot run ci [all] 
   - To trigger specific jobs: @mxnet-bot run ci [job1, job2] 
   *** 
   **CI supported jobs**: [sanity, edge, unix-cpu, windows-cpu, windows-gpu, unix-gpu, centos-gpu, clang, centos-cpu, miscellaneous, website]
   *** 
   _Note_: 
    Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin. 
   All CI tests must pass before the PR can be merged. 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] leezu merged pull request #19475: Avoid segfault when calling __repr__ on ndarray or symbol with freed handle

Posted by GitBox <gi...@apache.org>.
leezu merged pull request #19475:
URL: https://github.com/apache/incubator-mxnet/pull/19475


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-mxnet] szha commented on a change in pull request #19475: Avoid segfault when calling __repr__ on ndarray or symbol with freed handle

Posted by GitBox <gi...@apache.org>.
szha commented on a change in pull request #19475:
URL: https://github.com/apache/incubator-mxnet/pull/19475#discussion_r517540117



##########
File path: python/mxnet/symbol/symbol.py
##########
@@ -73,12 +73,15 @@ def as_nd_ndarray(self):
 
     def __repr__(self):
         """Gets a string representation of the symbol."""
-        name = self.name
-        if name is None:
-            name = ', '.join([i.name for i in self])
-            return '<%s group [%s]>' % (self.__class__.__name__, name)
+        if self._alive:
+            name = self.name
+            if name is None:
+                name = ', '.join([i.name for i in self])
+                return '<%s group [%s]>' % (self.__class__.__name__, name)
+            else:
+                return '<%s %s>' % (self.__class__.__name__, name)
         else:
-            return '<%s %s>' % (self.__class__.__name__, name)
+            return 'FREED Symbol'

Review comment:
       let's apply similar changes to other occurrences too.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org