View Issue Details

IDProjectCategoryView StatusLast Update
0003034GNUnetfile-sharing servicepublic2013-12-24 20:54
ReporterLRN Assigned ToChristian Grothoff  
PriorityurgentSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product VersionGit master 
Target Version0.10.0Fixed in Version0.10.0 
Summary0003034: FS tests crash on publishing
DescriptionI've debugged the problem, and here's what is happening.
At some point GNUnet tries to call FileInfo->data.file.reader(), but reader is NULL. This usually happens in copy_from_reader (called from GNUNET_FS_file_information_sync_(), calls for GNUNET_FS_file_information_sync_ are sprayed all over the place, there's a backtrace below for one of them).
reader is NULL because of GNUNET_FS_tree_encoder_finish() (the second backtrace below). It calls its TE reader with zeros, to finalize it. And block_reader (the TE reader implementation in question) calls the data.file.reader with zeros to finalize it, and then NULLifies the data.file.reader points to make sure it's never called again.

So, encode_cont() first calls GNUNET_FS_tree_encoder_finish(), which zeroes the reader, then calls GNUNET_FS_file_information_sync_ (), which calls the zeroed reader.
Additional Information
Reading symbols from F:\src\gnunet-git-svn\src\fs\.libs\test_fs_download_persistence.exe...done.
Continuing.

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 4724.0x2654]
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x69c05879 in copy_from_reader (wh=0xa2d808, fi=0xa1d388) at fs_api.c:1207
#2  0x69c05da8 in GNUNET_FS_file_information_sync_ (fi=0xa1d388) at fs_api.c:1298
#3  0x69c1b950 in encode_cont (cls=0xa2d600, tc=0x0) at fs_publish.c:426
#4  0x69c276a3 in GNUNET_FS_tree_encoder_next (te=0xa0de68) at fs_tree.c:354
#5  0x69c1c723 in publish_content (pc=0xa2d600) at fs_publish.c:606
#6  0x69c1d85c in GNUNET_FS_publish_main_ (cls=0xa2d600, tc=0x28fd60) at fs_publish.c:892
#7  0x62b7a3bd in run_ready (rs=0xa19de0, ws=0xa1adf8) at scheduler.c:597
#8  0x62b7ac39 in GNUNET_SCHEDULER_run (task=0x6d4c5261 <service_run_main>, task_cls=0x28fe4c) at scheduler.c:806
#9  0x6d4c55b3 in GNUNET_TESTING_service_run (testdir=0x40b090 <_Jv_RegisterClasses+4239504> "test-fs-download-persistence", service_name=0x6d4d32b0 <_Jv_RegisterClasses+1833775792> "arm",
    cfgfilename=0x40b29e <_Jv_RegisterClasses+4240030> "test_fs_download_data.conf", tm=0x4031fe <run>, tm_cls=0x0) at testing.c:1741
#10 0x6d4c525f in GNUNET_TESTING_peer_run (testdir=0x40b090 <_Jv_RegisterClasses+4239504> "test-fs-download-persistence", cfgfilename=0x40b29e <_Jv_RegisterClasses+4240030> "test_fs_download_data.conf",
    tm=0x4031fe <run>, tm_cls=0x0) at testing.c:1611
#11 0x00403634 in main (argc=1, argv=0x9f9658) at test_fs_download_persistence.c:326
(gdb) up
#1  0x69c05879 in copy_from_reader (wh=0xa2d808, fi=0xa1d388) at fs_api.c:1207
1207        ret =
(gdb) l
1202      emsg = NULL;
1203      off = 0;
1204      while (off < fi->data.file.file_size)
1205      {
1206        left = GNUNET_MIN (sizeof (buf), fi->data.file.file_size - off);
1207        ret =
1208            fi->data.file.reader (fi->data.file.reader_cls, off, left, buf, &emsg);
1209        if (0 == ret)
1210        {
1211          GNUNET_free (emsg);
(gdb) up
#2  0x69c05da8 in GNUNET_FS_file_information_sync_ (fi=0xa1d388) at fs_api.c:1298
1298          if (GNUNET_OK != copy_from_reader (wh, fi))
(gdb)
#3  0x69c1b950 in encode_cont (cls=0xa2d600, tc=0x0) at fs_publish.c:426
426       GNUNET_FS_file_information_sync_ (p);
(gdb) l
421         pi.value.publish.specifics.progress.offset = flen;
422         pi.value.publish.specifics.progress.data_len = 0;
423         pi.value.publish.specifics.progress.depth = GNUNET_FS_compute_depth (flen);
424         p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, flen);
425       }
426       GNUNET_FS_file_information_sync_ (p);
427       /* continue with main */
428       GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == pc->upload_task);
429       pc->upload_task =
430           GNUNET_SCHEDULER_add_with_priority (GNUNET_SCHEDULER_PRIORITY_BACKGROUND,

encoder_finish (conditional abort call is inserted by me):
Reading symbols from F:\src\gnunet-git-svn\src\fs\.libs\test_fs_download_persistence.exe...done.
Continuing.

Program received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 12576.0x23a8]
0x7522321a in KERNELBASE!DebugBreak () from C:\Windows\syswow64\KernelBase.dll
(gdb) bt
#0  0x7522321a in KERNELBASE!DebugBreak () from C:\Windows\syswow64\KernelBase.dll
#1  0x62b4704a in GNUNET_abort () at common_logging.c:289
#2  0x69c2814f in GNUNET_FS_tree_encoder_finish (te=0x21f0488, uri=0x2201770, emsg=0x27fa7c, checkptr=0x22017a8) at fs_tree.c:438
#3  0x69c1ba8f in encode_cont (cls=0x22119d0, tc=0x0) at fs_publish.c:424
#4  0x69c27c07 in GNUNET_FS_tree_encoder_next (te=0x21f0488) at fs_tree.c:354
#5  0x69c1cb53 in publish_content (pc=0x22119d0) at fs_publish.c:636
#6  0x69c1dce0 in GNUNET_FS_publish_main_ (cls=0x22119d0, tc=0x28fd60) at fs_publish.c:928
#7  0x62b7a3bd in run_ready (rs=0x21fe3b8, ws=0x21ff3d0) at scheduler.c:597
#8  0x62b7ac39 in GNUNET_SCHEDULER_run (task=0x6d4c5261 <service_run_main>, task_cls=0x28fe4c) at scheduler.c:806
#9  0x6d4c55b3 in GNUNET_TESTING_service_run (testdir=0x40b090 <_Jv_RegisterClasses+4239504> "test-fs-download-persistence", service_name=0x6d4d32b0 <_Jv_RegisterClasses+1833775792> "arm",
    cfgfilename=0x40b29e <_Jv_RegisterClasses+4240030> "test_fs_download_data.conf", tm=0x4031fe <run>, tm_cls=0x0) at testing.c:1741
#10 0x6d4c525f in GNUNET_TESTING_peer_run (testdir=0x40b090 <_Jv_RegisterClasses+4239504> "test-fs-download-persistence", cfgfilename=0x40b29e <_Jv_RegisterClasses+4240030> "test_fs_download_data.conf",
    tm=0x4031fe <run>, tm_cls=0x0) at testing.c:1611
#11 0x00403634 in main (argc=1, argv=0x21d9658) at test_fs_download_persistence.c:326
TagsNo tags attached.

Activities

Christian Grothoff

2013-09-14 15:51

manager   ~0007450

Should be fixed in SVN 29247.

Issue History

Date Modified Username Field Change
2013-09-14 01:26 LRN New Issue
2013-09-14 14:34 Christian Grothoff Assigned To => Christian Grothoff
2013-09-14 14:34 Christian Grothoff Status new => assigned
2013-09-14 15:01 Christian Grothoff Priority normal => urgent
2013-09-14 15:01 Christian Grothoff Product Version => Git master
2013-09-14 15:01 Christian Grothoff Target Version => 0.10.0
2013-09-14 15:51 Christian Grothoff Note Added: 0007450
2013-09-14 15:51 Christian Grothoff Status assigned => resolved
2013-09-14 15:51 Christian Grothoff Fixed in Version => 0.10.0
2013-09-14 15:51 Christian Grothoff Resolution open => fixed
2013-12-24 20:54 Christian Grothoff Status resolved => closed