[ libetpan-Support Requests-942266 ] segmentation fault on mailstorage_connect()

"SourceForge.net" <[email protected]>
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
Support Requests item #942266, was opened at 2004-04-26 12:12
Message generated for change (Settings changed) made by hoa
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=429697&aid=942266&group_id=41064

>Category: None
>Group: None
Status: Open
Priority: 1
Submitted By: Toni Willberg (toniw)
Assigned to: Nobody/Anonymous (nobody)
Summary: segmentation fault on mailstorage_connect()

Initial Comment:
Hi. 

I've got a reproducable crash with example program frm-tree

It seems to crash when doing:
  ./frm-tree --driver=pop

It doesn't seem to matter if I give it the server
hostname, port, username, or whatever.

It works with imap driver.


$ gdb

(gdb) file frm-tree
Reading symbols from frm-tree...done.
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run --driver=pop
Starting program:
/local/src/libetpan-0.32/tests/frm-tree --driver=pop
 
Program received signal SIGSEGV, Segmentation fault.
0x4007d893 in mailstorage_connect (storage=0x804a308)
at mailstorage.c:298
298     mailstorage.c: No such file or directory.
        in mailstorage.c
(gdb) bt
#0  0x4007d893 in mailstorage_connect
(storage=0x804a308) at mailstorage.c:298
#1  0x4007d5d9 in mailfolder_connect (folder=0x804a338)
at mailstorage.c:133
#2  0x080490a6 in main (argc=0, argv=0x0) at frm-tree.c:187
(gdb)


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2004-04-27 06:07

Message:
Logged In: NO 

however, frm is some test program and sure this initialize a storage
which is invalid when exiting from init_storage() thing.

even driver value given by parse_option() in frm.c is not
valid when giving a bad driver name (driver = -1)

When a bad value is given, there is no default driver, then
the storage is not valid at the end of init_storage() call.

Maybe I will commit later a version that handles error.


----------------------------------------------------------------------

Comment By: DINH V. Hoa (hoa)
Date: 2004-04-26 21:35

Message:
Logged In: YES 
user_id=201468

in fact, the name of the driver you have to give is : pop3

what you can find in option-parser.c :

<<

  options
  
  --driver (pop3|imap|nntp|mbox|mh|maildir)  -d

  default driver is mbox

  --server {server-name} -s
  --port {port-number}   -p
  --tls                  -t
  --starttls             -x
  --user {login}         -u
  --password {password}  -v
  --path {mailbox}       -l
  --apop                 -a
  --cache {directory}    -c
  --flags {directory}    -f
>>


----------------------------------------------------------------------

Comment By: Toni Willberg (toniw)
Date: 2004-04-26 12:23

Message:
Logged In: YES 
user_id=190645

After more testing, it seems to crash with the same error if
you try to use a nonexisting driver.

With more debugging, it seems to try to access local mail
folders if you give it a nonexisting driver:

<<<
(gdb) print storage
$1 = (struct mailstorage *) 0x804a308
(gdb) print storage[0]
$2 = {sto_id = 0x0, sto_data = 0x0, sto_session = 0x0,
sto_driver = 0x0, sto_shared_folders = 0x804a328,
sto_user_data = 0x0}
(gdb) print storage[0]
$3 = {sto_id = 0x0, sto_data = 0x0, sto_session = 0x0,
sto_driver = 0x0, sto_shared_folders = 0x804a328,
sto_user_data = 0x0}
(gdb) print storage[1]
$4 = {sto_id = 0x0, sto_data = 0x11, sto_session = 0x0,
sto_driver = 0x0, sto_shared_folders = 0x0, sto_user_data =
0x31}
(gdb) print storage[2]
$5 = {sto_id = 0x804a368 "/var/mail/twillber", sto_data =
0x0, sto_session = 0x804a308, sto_driver = 0x0,
sto_shared_folders = 0x0,
  sto_user_data = 0x0}
>>>

The $5 suggests it tries to use local mail.
I think it would be wise to give the user an error instead
of using some hardcoded default driver.

I actually tried to test pop3-functionality in first place... :)



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=429697&aid=942266&group_id=41064


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.