Bug 4324 - slurp(pid) doesn't append trailing NUL
Summary: slurp(pid) doesn't append trailing NUL
Alias: None
Product: frysk
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Petr Machata
Depends on:
Blocks: 1582
  Show dependency treegraph
Reported: 2007-04-05 18:03 UTC by Petr Machata
Modified: 2007-04-20 14:50 UTC (History)
0 users

See Also:
Host: i686-redhat-linux-gnu
Target: i686-redhat-linux-gnu
Build: i686-redhat-linux-gnu
Last reconfirmed:

fix for this problem (252 bytes, patch)
2007-04-05 18:05 UTC, Petr Machata
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Machata 2007-04-05 18:03:55 UTC
I found a minor bug in uslurp(int pid, const char* name).  It doesn't
append a NUL character.  MapsBuilder.construct then throws an exception:

Exception in thread "Thread-1" java.lang.RuntimeException: missing NUL
   at frysk.sys.proc.MapsBuilder.construct(fltrace)
   at frysk.sys.proc.MapsBuilder.construct(fltrace)
   at fltrace.updateAttached(fltrace)
   at frysk.proc.Task.notifyAttached(fltrace)
   at frysk.proc.LinuxPtraceTaskState$Attached.transitionToRunningState(fltrace)
   at frysk.proc.LinuxPtraceTaskState$StartMainTask$6.blockOrAttachContinue(fltrace)
   at frysk.proc.LinuxPtraceTaskState$StartMainTask$6.handleTrappedEvent(fltrace)
   at frysk.proc.Task.processTrappedEvent(fltrace)
   at frysk.proc.LinuxPtraceHost$PollWaitOnSigChld$5.stopped(fltrace)
   at frysk.sys.Wait.waitAllNoHang(fltrace)
   at frysk.proc.LinuxPtraceHost$PollWaitOnSigChld.execute(fltrace)
   at frysk.event.EventLoop.runEventLoop(fltrace)
   at frysk.event.EventLoop.run(fltrace)
Comment 1 Petr Machata 2007-04-05 18:05:08 UTC
Created attachment 1670 [details]
fix for this problem

Tested on clean today's checkout, no regressions.
Comment 2 Petr Machata 2007-04-05 18:13:40 UTC
Not sure if I assigned it to right tracker bug.
Comment 3 Petr Machata 2007-04-20 15:50:49 UTC
Fix commited.