bugDotGNU Portable.NET - Bugs: bug #12238, String.Replace results in 100%...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #12238: String.Replace results in 100% CPU, does not return

Submitted by:  Heiko Weiss <brubbel>
Submitted on:  Mon 07 Mar 2005 07:38:05 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

(Jump to the original submission Jump to the original submission)

Wed 09 Mar 2005 08:42:43 AM UTC, comment #6:

fixed in cvs

Deryk Robosson <drobosson>
Project Member
Wed 09 Mar 2005 08:09:01 AM UTC, comment #5:

I have attached a patch to fix allocation issues in the String_Replace functions.
Also fixed the off by one bug (thx. Erich). This was the cause of GC segfaulting.

Klaus Treichel <ktreichel>
Project Administrator
Wed 09 Mar 2005 06:51:17 AM UTC, comment #4:

(ooops, posted too fast)

pnet/engine/lib_string.c line 1336

Erich Kitzmüller <ammoq>
Wed 09 Mar 2005 06:46:24 AM UTC, comment #3:

while((posn) <= _this->length)

IMO off by one, should be <

Erich Kitzmüller <ammoq>
Mon 07 Mar 2005 10:29:22 AM UTC, comment #2:

When test case ran alone, CPU usage tilts. When ran in gdb, back trace is consistant with that shown by Klaus.

Deryk Robosson <drobosson>
Project Member
Mon 07 Mar 2005 10:22:02 AM UTC, comment #1:

Segfaults for me on cygwin with current cvs:

Starting program: /usr/local/bin/ilrun.exe a.exe
Bevore Replace

Program received signal SIGSEGV, Segmentation fault.
0x004a8883 in GC_mark_from (mark_stack_top=0x10029600, mark_stack=0x100290a8,
mark_stack_limit=0x100310a8) at mark.c:759
759 deferred = *limit;
(gdb) bt
#0 0x004a8883 in GC_mark_from (mark_stack_top=0x10029600,
mark_stack=0x100290a8, mark_stack_limit=0x100310a8) at mark.c:759
#1 0x004a8472 in GC_mark_some (cold_gc_frame=0x22e90c "é\002") at mark.c:293
#2 0x004a3f25 in GC_stopped_mark (stop_func=0x4a3790 <GC_never_stop_func>)
at alloc.c:520
#3 0x004a3bda in GC_try_to_collect_inner (
stop_func=0x4a3790 <GC_never_stop_func>) at alloc.c:367
#4 0x004a4a0c in GC_collect_or_expand (needed_blocks=1, ignore_off_page=0)
at alloc.c:1020
#5 0x004a545a in GC_alloc_large (lw=745, k=4, flags=0) at malloc.c:61
#6 0x004a5755 in GC_generic_malloc (lb=2979, k=4) at malloc.c:204
#7 0x004a66b3 in GC_malloc_explicitly_typed (lb=2976, d=1073741825)
at typd_mlc.c:665
#8 0x0041f1a7 in _ILEngineAllocAtomic (thread=0x10035f50,
classInfo=0x1008ff78, size=2968) at heap.c:261
#9 0x0041cd51 in AllocString (thread=0x10035f50, length=1480)
at lib_string.c:36
#10 0x0041df52 in _IL_String_Replace_StringString (thread=0x10035f50,
_this=0x102b4008, oldValue=0x102a0698, newValue=0x102a0648)
(gdb)
#11 0x004a1957 in ffi_call_SYSV () at src/x86/win32.S:61
#12 0x004a171f in ffi_raw_call (cif=0x100829d0,
fn=0x41de80 <_IL_String_Replace_StringString>, rvalue=0x10036020,
fake_avalue=0x10036024) at src/x86/ffi.c:515
---Type <return> to continue, or q <return> to quit---
#13 0x00413e27 in _ILCVMInterpreter (thread=0x10035f50) at cvm_call.c:855
#14 0x0041007a in _ILCallMethod (thread=0x10035f50, method=0x1007e398,
unpack=0x40fed0 <_ILCallUnpackVResult>, result=0x22ef60, isCtor=0,
_this=0x0, pack=0x40fc00 <_ILCallPackVParams>, userData=0x22ef70)
at call.c:706
#15 0x004104a4 in ILExecThreadCallV (thread=0x10035f50, method=0x1007e398,
result=0x22ef60, args=0x22ef70) at call.c:928
#16 0x004016df in main (argc=2, argv=0x10022b98) at ilrun.c:494

Klaus Treichel <ktreichel>
Project Administrator
Mon 07 Mar 2005 07:38:05 AM UTC, original submission:

see sample.
If U try my sample the first time it runs, the second time ilrun needs 100% CPU and does not return from Strinf.Replace.

Heiko Weiss <brubbel>
Project Member

 

Attached Files
file #2699:  KTreichel-050309.patch added by ktreichel (4KiB - text/plain - patch to fix allocation issues in String.Replace)
file #2693:  StringReplace.cs added by brubbel (2KiB - text/plain - sample wich hangs)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 4 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Wed 09 Mar 2005 08:42:43 AM UTCdrobossonStatusNone=>Fixed
  Open/ClosedOpen=>Closed
Wed 09 Mar 2005 08:09:01 AM UTCktreichelAttached File-=>Added KTreichel-050309.patch, #2292
Mon 07 Mar 2005 07:38:05 AM UTCbrubbelAttached File-=>Added StringReplace.cs, #2288

Back to the top


Powered by Savane 3.1-cleanup1